public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: GOTO Masanori <gotom@sanori.org>
To: Jesper Juhl <jesper.juhl@gmail.com>
Cc: linux-scsi@vger.kernel.org,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	James Bottomley <James.Bottomley@steeleye.com>,
	Andrew Morton <akpm@osdl.org>,
	YOKOTA Hiroshi <yokota@netlab.is.tsukuba.ac.jp>,
	GOTO Masanori <gotom@debian.or.jp>,
	gotom@debian.org
Subject: Re: [PATCH]Add scsi_add_host() failure handling for nsp32
Date: Fri, 13 Jan 2006 00:59:58 +0900	[thread overview]
Message-ID: <81oe2hcu81.wl%gotom@sanori.org> (raw)
In-Reply-To: <200601101411.52585.jesper.juhl@gmail.com>

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 \x13csi_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 <gotom@sanori.org>

--- 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);
 

      reply	other threads:[~2006-01-12 16:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-10 13:11 [PATCH]Add scsi_add_host() failure handling for nsp32 Jesper Juhl
2006-01-12 15:59 ` GOTO Masanori [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=81oe2hcu81.wl%gotom@sanori.org \
    --to=gotom@sanori.org \
    --cc=James.Bottomley@steeleye.com \
    --cc=akpm@osdl.org \
    --cc=gotom@debian.or.jp \
    --cc=gotom@debian.org \
    --cc=jesper.juhl@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=yokota@netlab.is.tsukuba.ac.jp \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox