The BUG_ON() checks in this function are not necessary.

comedi_cleanup_board_minors() clears all the entries in the
comedi_board_minor_table array and will call comedi_device_cleanup()
for all attached devices. comedi_device_cleanup() will then
clear the entries in the comedi_subdevice_minor_table array with
comedi_free_subdevice_minor().

Remove the BUG_ON(), drivers should not crash the kernel.

Signed-off-by: H Hartley Sweeten <hswee...@visionengravers.com>
Cc: Ian Abbott <abbo...@mev.co.uk>
Cc: Greg Kroah-Hartman <gre...@linuxfoundation.org>
---
 drivers/staging/comedi/comedi_fops.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/drivers/staging/comedi/comedi_fops.c 
b/drivers/staging/comedi/comedi_fops.c
index dbca28f..f4dc7a3 100644
--- a/drivers/staging/comedi/comedi_fops.c
+++ b/drivers/staging/comedi/comedi_fops.c
@@ -2926,14 +2926,7 @@ module_init(comedi_init);
 
 static void __exit comedi_cleanup(void)
 {
-       int i;
-
        comedi_cleanup_board_minors();
-       for (i = 0; i < COMEDI_NUM_BOARD_MINORS; ++i)
-               BUG_ON(comedi_board_minor_table[i]);
-       for (i = 0; i < COMEDI_NUM_SUBDEVICE_MINORS; ++i)
-               BUG_ON(comedi_subdevice_minor_table[i]);
-
        class_destroy(comedi_class);
        cdev_del(&comedi_cdev);
        unregister_chrdev_region(MKDEV(COMEDI_MAJOR, 0), COMEDI_NUM_MINORS);
-- 
2.4.3

_______________________________________________
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to