mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Meelis Roos <mroos@linux.ee>
To: Adaptec OEM Raid Solutions <aacraid@adaptec.com>
Cc: linux-scsi@vger.kernel.org,
	Linux Kernel list <linux-kernel@vger.kernel.org>
Subject: [PATCH] dpt_i2o: fix module removal BUG
Date: Tue, 31 May 2011 10:01:22 +0300 (EEST)	[thread overview]
Message-ID: <alpine.SOC.1.00.1105310956250.26883@math.ut.ee> (raw)
In-Reply-To: <alpine.SOC.1.00.1105251206580.19636@math.ut.ee>

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)

      reply	other threads:[~2011-05-31  7:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-25 15:36 BUG on dpt_i2o module removal Meelis Roos
2011-05-31  7:01 ` Meelis Roos [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.SOC.1.00.1105310956250.26883@math.ut.ee \
    --to=mroos@linux.ee \
    --cc=aacraid@adaptec.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®