linux/drivers/staging/dgnc
Sudip Mukherjee 18f038e6bf staging: dgnc: cleanup properly
dgnc_cleanup_module() was called when the module unloaded to do a total
cleanup and it was also called if pci_register_driver() fails. But
dgnc_cleanup_module() will try dgnc_remove_driver_sysfiles() but the
sysfiles will be created only if pci_register_driver() succeeds.
So if pci_register_driver() fails and we try dgnc_cleanup_module() then we
were getting:

[  942.001479] BUG: unable to handle kernel NULL pointer dereference at 00000018
[  942.001482] IP: [<c122c7a8>] sysfs_remove_file_ns+0x8/0x20

with part of the call trace as:

[  942.001544] Call Trace:
[  942.001555]  [<c149acc6>] driver_remove_file+0x16/0x20
[  942.001571]  [<f864a708>] dgnc_remove_driver_sysfiles+0x18/0x40 [dgnc]
[  942.001575]  [<f8643ac7>] dgnc_cleanup_module+0x47/0x260 [dgnc]
[  942.001577]  [<f86cb000>] ? 0xf86cb000
[  942.001580]  [<f86cb1e6>] dgnc_init_module+0x1e6/0x1000 [dgnc]

Lets have a separate cleanup function which will execute
dgnc_remove_driver_sysfiles() depending on the argument passed to it.

Reported-by: Navy Cheng <navych@126.com>
Signed-off-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
..
dgnc_cls.c staging: dgnc: delete parentheses around right hand side of assignment 2016-03-11 22:09:09 -08:00
dgnc_cls.h dgnc: remove unused stuff from dgnc_cls.h 2015-03-24 15:41:00 +01:00
dgnc_driver.c staging: dgnc: cleanup properly 2016-03-11 22:09:09 -08:00
dgnc_driver.h staging: dgnc: Avoid multiple blank lines 2016-03-11 22:09:09 -08:00
dgnc_mgmt.c staging: dgnc: delete parentheses around right hand side of assignment 2016-03-11 22:09:09 -08:00
dgnc_mgmt.h dgnc: clean up comments at start of files 2015-03-12 11:11:17 +01:00
dgnc_neo.c staging: dgnc: delete parentheses around right hand side of assignment 2016-03-11 22:09:09 -08:00
dgnc_neo.h staging: dgnc: Avoid multiple blank lines 2016-03-11 22:09:09 -08:00
dgnc_pci.h staging: dgnc: Avoid multiple blank lines 2016-03-11 22:09:09 -08:00
dgnc_sysfs.c staging: dgnc: remove parenthesis 2015-10-12 21:08:51 -07:00
dgnc_sysfs.h staging: dgnc: Remove unnecessary externs 2015-08-14 18:51:57 -07:00
dgnc_tty.c staging: dgnc: Break line after boolean operator 2016-03-11 22:09:09 -08:00
dgnc_tty.h dgnc: clean up comments at start of files 2015-03-12 11:11:17 +01:00
dgnc_utils.c Staging: dgnc: Remove unused #include header file 2015-11-15 20:02:47 -08:00
dgnc_utils.h dgnc: remove unused dgnc_ioctl_name() command 2015-03-24 15:40:59 +01:00
digi.h staging: dgnc: Add spaces around '|' and '<<' 2016-03-11 22:09:09 -08:00
Kconfig
Makefile dgnc: Move DG_PART definition from Makefile to dgnc_driver.h 2015-03-12 11:05:27 +01:00
TODO Staging: fixed multiple spelling errors. 2015-05-08 09:23:58 +02:00