Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 98c35534 authored by Lothar Waßmann's avatar Lothar Waßmann Committed by Greg Kroah-Hartman
Browse files

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: default avatarLothar Waßmann <LW@KARO-electronics.de>
Cc: stable <stable@vger.kernel.org> # 3.6
Acked-by: default avatarAlexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 9db72fe6
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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);