mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@digeo.com>
To: LKML <linux-kernel@vger.kernel.org>
Cc: wa1ter@myrealbox.com
Subject: Re: [Bug 492] New: Zip drive parallel-port driver causes segfault in 2.5.x
Date: Sun, 23 Mar 2003 16:15:48 -0800	[thread overview]
Message-ID: <20030323161548.44d5a278.akpm@digeo.com> (raw)
In-Reply-To: <2070000.1048457694@[10.10.2.4]>

"Martin J. Bligh" <mbligh@aracnet.com> wrote:
>
> Problem Description: ppa module doesn't work properly and, if compiled into
> kernel it causes a kernel panic at boot.
> Steps to reproduce:compile ppa.ko as a module and modprobe ppa:

Null-pointer deref.  This fixes it for me, but I'm not sure why the detect
routing is returning with the host lock held.  Maybe scsi detect routines are
supposed to do that?

diff -puN drivers/scsi/ppa.c~ppa-null-pointer-fix drivers/scsi/ppa.c
--- 25/drivers/scsi/ppa.c~ppa-null-pointer-fix	2003-03-23 16:08:37.000000000 -0800
+++ 25-akpm/drivers/scsi/ppa.c	2003-03-23 16:09:14.000000000 -0800
@@ -219,13 +219,15 @@ int ppa_detect(Scsi_Host_Template * host
 	    printk("  supported by the imm (ZIP Plus) driver. If the\n");
 	    printk("  cable is marked with \"AutoDetect\", this is what has\n");
 	    printk("  happened.\n");
-	    spin_lock_irq(hreg->host_lock);
+	    if (hreg)	/* This is silly */
+		spin_lock_irq(hreg->host_lock);
 	    return 0;
 	}
 	try_again = 1;
 	goto retry_entry;
     } else {
-	spin_lock_irq(hreg->host_lock);
+	if (hreg)	/* And this should be unnecessary */
+		spin_lock_irq(hreg->host_lock);
 	return 1;		/* return number of hosts detected */
     }
 }

_


      parent reply	other threads:[~2003-03-24  0:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-23 22:14 Martin J. Bligh
2003-03-23 22:56 ` Andries Brouwer
2003-03-24  0:15 ` 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=20030323161548.44d5a278.akpm@digeo.com \
    --to=akpm@digeo.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=wa1ter@myrealbox.com \
    /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®