diff options
author | Lothar Waßmann <LW@KARO-electronics.de> | 2012-11-22 10:11:25 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-11-26 23:59:00 +0100 |
commit | 98c35534420d3147553bd3071a5fc63cd56de5b1 (patch) | |
tree | cf24357c739a1b9d1bc6a2ca0108c6c9a9c1bee5 /drivers/usb/chipidea | |
parent | ezusb: add dependency to USB (diff) | |
download | linux-98c35534420d3147553bd3071a5fc63cd56de5b1.tar.xz linux-98c35534420d3147553bd3071a5fc63cd56de5b1.zip |
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>
Diffstat (limited to 'drivers/usb/chipidea')
-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); void ci13xxx_remove_device(struct platform_device *pdev) { + int id = pdev->id; platform_device_unregister(pdev); - ida_simple_remove(&ci_ida, pdev->id); + ida_simple_remove(&ci_ida, id); } EXPORT_SYMBOL_GPL(ci13xxx_remove_device); |