Skip to content

Commit

Permalink
[SCSI] zalon: fix oops on attach failure
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
James Bottomley authored and James Bottomley committed Jun 25, 2009
1 parent e3f47cc commit d3a263a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/scsi/zalon.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 ",
Expand Down

0 comments on commit d3a263a

Please sign in to comment.