diff options
author | Lothar Waßmann <LW@KARO-electronics.de> | 2012-11-22 04:11:25 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-11-26 17:59:00 -0500 |
commit | 98c35534420d3147553bd3071a5fc63cd56de5b1 (patch) | |
tree | cf24357c739a1b9d1bc6a2ca0108c6c9a9c1bee5 | |
parent | 9db72fe6c943852032d9ed863c87e8c02d3cb9da (diff) |
USB: chipidea: fix use after free bug
The pointer to a platform_device struct must not be dereferenced after
the device has been unregistered.
This bug produces a crash when unloading the ci13xxx kernel module
compiled with CONFIG_PAGE_POISONING enabled.
Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
Cc: stable <stable@vger.kernel.org> # 3.6
Acked-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/usb/chipidea/core.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c index 5a4a5eca4194..aebf695a9344 100644 --- a/drivers/usb/chipidea/core.c +++ b/drivers/usb/chipidea/core.c | |||
@@ -385,8 +385,9 @@ EXPORT_SYMBOL_GPL(ci13xxx_add_device); | |||
385 | 385 | ||
386 | void ci13xxx_remove_device(struct platform_device *pdev) | 386 | void ci13xxx_remove_device(struct platform_device *pdev) |
387 | { | 387 | { |
388 | int id = pdev->id; | ||
388 | platform_device_unregister(pdev); | 389 | platform_device_unregister(pdev); |
389 | ida_simple_remove(&ci_ida, pdev->id); | 390 | ida_simple_remove(&ci_ida, id); |
390 | } | 391 | } |
391 | EXPORT_SYMBOL_GPL(ci13xxx_remove_device); | 392 | EXPORT_SYMBOL_GPL(ci13xxx_remove_device); |
392 | 393 | ||