From patchwork Wed Jun 24 19:55:22 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Bottomley X-Patchwork-Id: 32240 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n5OJtReP014474 for ; Wed, 24 Jun 2009 19:55:27 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751656AbZFXTzX (ORCPT ); Wed, 24 Jun 2009 15:55:23 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751485AbZFXTzX (ORCPT ); Wed, 24 Jun 2009 15:55:23 -0400 Received: from bedivere.hansenpartnership.com ([66.63.167.143]:40545 "EHLO bedivere.hansenpartnership.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751306AbZFXTzW (ORCPT ); Wed, 24 Jun 2009 15:55:22 -0400 Received: from localhost (localhost [127.0.0.1]) by bedivere.hansenpartnership.com (Postfix) with ESMTP id E94C08EE0FC; Wed, 24 Jun 2009 12:55:25 -0700 (PDT) Received: from bedivere.hansenpartnership.com ([127.0.0.1]) by localhost (bedivere.hansenpartnership.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4FyDQ2O9lPll; Wed, 24 Jun 2009 12:55:25 -0700 (PDT) Received: from [192.168.10.224] (newmulgrave.ext.hansenpartnership.com [192.168.10.224]) by bedivere.hansenpartnership.com (Postfix) with ESMTP id 7A03D8EE0C8; Wed, 24 Jun 2009 12:55:25 -0700 (PDT) Subject: [PATCH] zalon: fix oops on attach failure From: James Bottomley To: linux-scsi , Parisc List Date: Wed, 24 Jun 2009 19:55:22 +0000 Message-Id: <1245873322.4022.385.camel@mulgrave.site> Mime-Version: 1.0 X-Mailer: Evolution 2.24.1.1 Sender: linux-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org 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. James --- -- To unsubscribe from this list: send the line "unsubscribe linux-parisc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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 ",