Staging: Beceem: use after free in bcm_exit()

We can't call class_destroy() until after the driver has been deregistered.
It leads to a NULL deref on module unload.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Dan Carpenter 2010-12-06 10:02:55 +03:00 committed by Greg Kroah-Hartman
parent cd0b0ebfbe
commit 6b74705e15
1 changed files with 1 additions and 2 deletions

View File

@ -658,9 +658,8 @@ static __init int bcm_init(void)
static __exit void bcm_exit(void)
{
class_destroy(bcm_class);
usb_deregister(&usbbcm_driver);
class_destroy(bcm_class);
}
module_init(bcm_init);