Skip to content

Commit

Permalink
USB: chipidea: fix use after free bug
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Lothar Waßmann authored and Greg Kroah-Hartman committed Nov 26, 2012
1 parent 9db72fe commit 98c3553
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/usb/chipidea/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 98c3553

Please sign in to comment.