[SCSI] zalon: fix oops on attach failure

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <git-commits-head@...>
Date: Friday, July 3, 2009 - 5:59 pm

Gitweb:     http://git.kernel.org/linus/d3a263a8168f78874254ea9da9595cfb0f3e96d7
Commit:     d3a263a8168f78874254ea9da9595cfb0f3e96d7
Parent:     e3f47cc74bddea8121560026185ede4770170043
Author:     James Bottomley <James.Bottomley@HansenPartnership.com>
AuthorDate: Wed Jun 24 19:55:22 2009 +0000
Committer:  James Bottomley <James.Bottomley@HansenPartnership.com>
CommitDate: Thu Jun 25 11:37:23 2009 -0500

    [SCSI] zalon: fix oops on attach failure
    
    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 |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/zalon.c b/drivers/scsi/zalon.c
index 97f3158..27e84e4 100644
--- a/drivers/scsi/zalon.c
+++ b/drivers/scsi/zalon.c
@@ -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 ",
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[SCSI] zalon: fix oops on attach failure, Linux Kernel Mailing List..., (Fri Jul 3, 5:59 pm)