lkml.org 
[lkml]   [2011]   [May]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] dpt_i2o: fix module removal BUG
dpt_i2o rmmod fails with

BUG: unable to handle kernel NULL pointer dereference at 00000004

The reason is that legacy scsi_unregister() expects that legacy
scsi_register() has been called before but this is not the case here.
Driver has been mostly converted to newer style scsi registration, so
scsi_host_put() is needed instead of scsi_unregister().

Also deletes obsolete comments around the fix.

Tested with DPT SmartRAID V with several module insertions and
removals.

Signed-off-by: Meelis Roos <mroos@linux.ee>

diff --git a/drivers/scsi/dpt_i2o.c b/drivers/scsi/dpt_i2o.c
index b4f6c9a..1f3df55 100644
--- a/drivers/scsi/dpt_i2o.c
+++ b/drivers/scsi/dpt_i2o.c
@@ -299,15 +299,11 @@ rebuild_sys_tab:
}


-/*
- * scsi_unregister will be called AFTER we return.
- */
static int adpt_release(struct Scsi_Host *host)
{
adpt_hba* pHba = (adpt_hba*) host->hostdata[0];
-// adpt_i2o_quiesce_hba(pHba);
adpt_i2o_delete_hba(pHba);
- scsi_unregister(host);
+ scsi_host_put(host);
return 0;
}

--
Meelis Roos (mroos@linux.ee)


\
 
 \ /
  Last update: 2011-05-31 09:03    [W:0.226 / U:0.496 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site