diff options
author | Gregory Fong <gregory.0xf0@gmail.com> | 2015-06-17 18:00:40 -0700 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2015-07-16 00:12:24 +0200 |
commit | 2252607d327d5219a6331b50e6ec266d56402be0 (patch) | |
tree | 572f1b3e57fff0cc51b87ebeaa91f4b1b08d2aeb /fs/notify/inotify | |
parent | 30bb6fb39e5c08b9db5bc592d6cbc9a5fc5e67a4 (diff) | |
download | op-kernel-dev-2252607d327d5219a6331b50e6ec266d56402be0.zip op-kernel-dev-2252607d327d5219a6331b50e6ec266d56402be0.tar.gz |
gpio: brcmstb: fix null ptr dereference in driver remove
If a failure occurs during probe, brcmstb_gpio_remove() is called. In
remove, we call platform_get_drvdata(), but at the time of failure in
the probe the driver data hadn't yet been set which leads to a NULL
ptr dereference in the remove's list_for_each. Call
platform_set_drvdata() and set up list head right after allocating the
priv struct to both avoid the null pointer dereference that could
occur today. To guard against potential future changes, check for
null pointer in remove.
Reported-by: Tim Ross <tross@broadcom.com>
Signed-off-by: Gregory Fong <gregory.0xf0@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'fs/notify/inotify')
0 files changed, 0 insertions, 0 deletions