From: Andrew Morton <akpm@osdl.org>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: bonnaud@lis.inpg.fr, 237477@bugs.debian.org, torvalds@osdl.org,
linux-kernel@vger.kernel.org
Subject: Re: Bug#237477: kernel-image-2.6.3-1-686: loading the aic7xxx module and then another module crashes the kernel
Date: Sat, 3 Apr 2004 01:48:34 -0800 [thread overview]
Message-ID: <20040403014834.3e2c6d81.akpm@osdl.org> (raw)
In-Reply-To: <20040403092429.GA16529@gondor.apana.org.au>
Herbert Xu <herbert@gondor.apana.org.au> wrote:
>
> This is because aic7xxx does not unregister itself properly if
> no devices are found. This patch fixes the problem.
It doesn't seem right in ahc_linux_detect(). If CONFIG_EISA && !CONFIG_PCI
we end up calling ahc_linux_pci_exit() even though we never called
ahc_linux_pci_init().
And it will break compilation in ahc_linux_eisa_init() for 2.4 kernel.
Incremental patch:
---
25-akpm/drivers/scsi/aic7xxx/aic7770_osm.c | 8 ++++++--
25-akpm/drivers/scsi/aic7xxx/aic7xxx_osm.c | 12 ++++++------
2 files changed, 12 insertions(+), 8 deletions(-)
diff -puN drivers/scsi/aic7xxx/aic7xxx_osm.c~aic7xxx-unload-fix-fix drivers/scsi/aic7xxx/aic7xxx_osm.c
--- 25/drivers/scsi/aic7xxx/aic7xxx_osm.c~aic7xxx-unload-fix-fix 2004-04-03 01:45:02.657931472 -0800
+++ 25-akpm/drivers/scsi/aic7xxx/aic7xxx_osm.c 2004-04-03 01:45:02.666930104 -0800
@@ -899,8 +899,12 @@ ahc_linux_detect(Scsi_Host_Template *tem
#ifdef CONFIG_EISA
found = ahc_linux_eisa_init();
- if (found)
- goto out_pci;
+ if (found) {
+#ifdef CONFIG_PCI
+ ahc_linux_pci_exit();
+#endif
+ goto out;
+ }
#endif
/*
@@ -919,10 +923,6 @@ ahc_linux_detect(Scsi_Host_Template *tem
out:
return (found);
-
-out_pci:
- ahc_linux_pci_exit();
- goto out;
}
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
diff -puN drivers/scsi/aic7xxx/aic7770_osm.c~aic7xxx-unload-fix-fix drivers/scsi/aic7xxx/aic7770_osm.c
--- 25/drivers/scsi/aic7xxx/aic7770_osm.c~aic7xxx-unload-fix-fix 2004-04-03 01:45:22.697884936 -0800
+++ 25-akpm/drivers/scsi/aic7xxx/aic7770_osm.c 2004-04-03 01:46:17.109613096 -0800
@@ -115,9 +115,10 @@ ahc_linux_eisa_init(void)
u_int slot;
u_int eisaBase;
u_int i;
+ int ret = -ENODEV;
if (aic7xxx_probe_eisa_vl == 0)
- return;
+ return ret;
eisaBase = 0x1000 + AHC_EISA_SLOT_OFFSET;
for (slot = 1; slot < NUMSLOTS; eisaBase+=0x1000, slot++) {
@@ -146,9 +147,12 @@ ahc_linux_eisa_init(void)
continue; /* no EISA card in slot */
entry = aic7770_find_device(eisa_id);
- if (entry != NULL)
+ if (entry != NULL) {
aic7770_linux_config(entry, NULL, eisaBase);
+ ret = 0;
+ }
}
+ return ret;
#endif
}
_
prev parent reply other threads:[~2004-04-03 9:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20040329215101.GB13646@gondor.apana.org.au>
[not found] ` <200403111908.i2BJ8n5I018032@mailhost-secour.lis.inpg.fr>
[not found] ` <handler.237477.D237477.10805970659443.notifdone@bugs.debian.org>
[not found] ` <1080748111.25431.12.camel@irancy.lis.inpg.fr>
2004-04-03 9:24 ` Herbert Xu
2004-04-03 9:48 ` Andrew Morton [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=20040403014834.3e2c6d81.akpm@osdl.org \
--to=akpm@osdl.org \
--cc=237477@bugs.debian.org \
--cc=bonnaud@lis.inpg.fr \
--cc=herbert@gondor.apana.org.au \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@osdl.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®