]> git.karo-electronics.de Git - linux-beck.git/commitdiff
[SCSI] zalon: fix oops on attach failure
authorJames Bottomley <James.Bottomley@HansenPartnership.com>
Wed, 24 Jun 2009 19:55:22 +0000 (19:55 +0000)
committerJames Bottomley <James.Bottomley@HansenPartnership.com>
Thu, 25 Jun 2009 16:37:23 +0000 (11:37 -0500)
I recently discovered on my zalon that if the attachment fails because
of a bus misconfiguration (I scrapped my HVD array, so the card is now
unterminated) then the system oopses.  The reason is that if
ncr_attach() returns NULL (signalling failure) that NULL is passed by
the goto failed straight into ncr_detach() which oopses.

The fix is just to return -ENODEV in this case.

Cc: Stable Tree <stable@kernel.org>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
drivers/scsi/zalon.c

index 97f3158fa7b546700ab670f3373598c5895cb546..27e84e4b1fa98857d571f3abafdfe9f4b03cf7ad 100644 (file)
@@ -134,7 +134,7 @@ zalon_probe(struct parisc_device *dev)
 
        host = ncr_attach(&zalon7xx_template, unit, &device);
        if (!host)
-               goto fail;
+               return -ENODEV;
 
        if (request_irq(dev->irq, ncr53c8xx_intr, IRQF_SHARED, "zalon", host)) {
          dev_printk(KERN_ERR, &dev->dev, "irq problem with %d, detaching\n ",