Skip to content

Commit

Permalink
Staging: Beceem: use after free in bcm_exit()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dan Carpenter authored and Greg Kroah-Hartman committed Dec 7, 2010
1 parent cd0b0eb commit 6b74705
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/staging/bcm/InterfaceInit.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 6b74705

Please sign in to comment.