Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030443AbWALQAQ (ORCPT ); Thu, 12 Jan 2006 11:00:16 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1030451AbWALQAQ (ORCPT ); Thu, 12 Jan 2006 11:00:16 -0500 Received: from omega.webmasters.gr.jp ([218.44.239.78]:43423 "EHLO webmasters.gr.jp") by vger.kernel.org with ESMTP id S1030443AbWALQAO (ORCPT ); Thu, 12 Jan 2006 11:00:14 -0500 Date: Fri, 13 Jan 2006 00:59:58 +0900 Message-ID: <81oe2hcu81.wl%gotom@sanori.org> From: GOTO Masanori To: Jesper Juhl Cc: linux-scsi@vger.kernel.org, Linux Kernel Mailing List , James Bottomley , Andrew Morton , YOKOTA Hiroshi , GOTO Masanori , gotom@debian.org Subject: Re: [PATCH]Add scsi_add_host() failure handling for nsp32 In-Reply-To: <200601101411.52585.jesper.juhl@gmail.com> References: <200601101411.52585.jesper.juhl@gmail.com> User-Agent: Wanderlust/2.11.30 (Wonderwall) SEMI/1.14.6 (Maruoka) FLIM/1.14.6 (Marutamachi) APEL/10.6 Emacs/21.4 (i386-pc-linux-gnu) MULE/5.0 (SAKAKI) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1587 Lines: 54 Dear Jesper, At Tue, 10 Jan 2006 14:11:52 +0100, Jesper Juhl wrote: > Add scsi_add_host() failure handling for nsp32 > and silence warning. > drivers/scsi/nsp32.c:2888: warning: ignoring return value of csi_add_host', declared with attribute warn_unused_result Thanks for your report and patch. However, I think your patch is not complete because the error route needs some additional clean up code. > #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,73)) > - scsi_add_host (host, &PCIDEV->dev); > + ret = scsi_add_host (host, &PCIDEV->dev); > + if (ret) { > + printk(KERN_WARNING "nsp32: scsi_add_host failed\n"); > + scsi_host_put(host); > + return ret; > + } How about this patch instead? -- gotom Signed-off-by: GOTO Masanori --- drivers/scsi/nsp32.c.gotom 2006-01-13 00:41:09.000000000 +0900 +++ drivers/scsi/nsp32.c 2006-01-13 00:54:26.661567144 +0900 @@ -2885,12 +2885,19 @@ } #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,73)) - scsi_add_host (host, &PCIDEV->dev); + ret = scsi_add_host(host, &PCIDEV->dev); + if (ret) { + nsp32_msg(KERN_ERR, "failed to add scsi host"); + goto free_region; + } scsi_scan_host(host); #endif pci_set_drvdata(PCIDEV, host); return DETECT_OK; + free_region: + release_region(host->io_port, host->n_io_port); + free_irq: free_irq(host->irq, data); - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/