[PATCH 5/7] Staging: Beceem: use after free in bcm_exit()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
---
 drivers/staging/bcm/InterfaceInit.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/bcm/InterfaceInit.c b/drivers/staging/bcm/InterfaceInit.c
index dd82940..b4d2256 100644
--- a/drivers/staging/bcm/InterfaceInit.c
+++ b/drivers/staging/bcm/InterfaceInit.c
@@ -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);
-- 
1.7.3.2.146.gca209.dirty
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel


[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux