From 90fdb0b98a62d78a0650b9fd3ddc58a48f71d740 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Mon, 8 Nov 2010 14:29:13 +0100 Subject: [PATCH] cciss: fix proc warning on attempt to remove non-existant directory Randy reports that he gets the following stack trace when removing the cciss module: [ 109.164277] Pid: 3463, comm: rmmod Not tainted 2.6.37-rc1 #7 [ 109.164280] Call Trace: [ 109.164292] [] warn_slowpath_common+0xc6/0xf3 [ 109.164299] [] warn_slowpath_fmt+0x5b/0x6b [ 109.164307] [] ? _raw_spin_unlock+0x40/0x4b [ 109.164313] [] remove_proc_entry+0x156/0x35e [ 109.164320] [] ? do_raw_spin_unlock+0xff/0x10f [ 109.164327] [] ? trace_hardirqs_on+0x10/0x4a [ 109.164333] [] ? _raw_spin_unlock_irq+0x4c/0x7b [ 109.164339] [] ? wait_for_common+0x145/0x15e [ 109.164345] [] ? default_wake_function+0x0/0x22 [ 109.164357] [] cciss_cleanup+0xa9/0xc7 [cciss] [ 109.164365] [] sys_delete_module+0x2d6/0x368 [ 109.164371] [] ? lockdep_sys_exit_thunk+0x35/0x67 [ 109.164377] [] ? audit_syscall_entry+0x172/0x1a5 [ 109.164383] [] ? trace_hardirqs_on_thunk+0x3a/0x3f [ 109.164389] [] system_call_fastpath+0x16/0x1b [ 109.164394] ---[ end trace 88e8568246ed0b1d ]--- which will happen if you don't actually have an HP CISS adapter, since it'll do an uncondional removal of a proc directory it never attempted to create in that case. Reported-by: Randy Dunlap Tested-by: Randy Dunlap Signed-off-by: Jens Axboe --- drivers/block/cciss.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c index 2cc4dda46279..2cdbc247d0ac 100644 --- a/drivers/block/cciss.c +++ b/drivers/block/cciss.c @@ -4936,7 +4936,8 @@ static void __exit cciss_cleanup(void) } } kthread_stop(cciss_scan_thread); - remove_proc_entry("driver/cciss", NULL); + if (proc_cciss) + remove_proc_entry("driver/cciss", NULL); bus_unregister(&cciss_bus_type); } -- 2.20.1