From: James Bottomley <James.Bottomley@SteelEye.com>
To: Jesper Juhl <jesper.juhl@gmail.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
linux-scsi@vger.kernel.org,
"Daniel M. Eischen" <deischen@iworks.interworks.org>,
Doug Ledford <dledford@redhat.com>
Subject: Re: [PATCH] fix warning and missing failure handling for scsi_add_host in aic7xxx driver
Date: Tue, 13 Dec 2005 21:33:59 -0700 [thread overview]
Message-ID: <1134534839.3133.2.camel@mulgrave> (raw)
In-Reply-To: <200512140007.20046.jesper.juhl@gmail.com>
On Wed, 2005-12-14 at 00:07 +0100, Jesper Juhl wrote:
> + if (retval) {
> + printk(KERN_ERR "aic7xxx: scsi_add_host failed\n");
> + goto free_and_out;
> + }
> +
> scsi_scan_host(host);
> - return (0);
> +
> +out:
> + return retval;
> +free_and_out:
> + scsi_remove_host(host);
> + goto out;
I'm not incredibly keen on all this jumping around for no reason. If
there's a normal out and an error out, then fine, but in this case the
if (retval) { } could contain the entirety of the error path with an
else for the normal path.
scsi_remove_host() is the wrong API, it should be scsi_host_put() (for
an allocated but un added host).
James
next prev parent reply other threads:[~2005-12-14 7:42 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-12-13 23:07 [PATCH] fix warning and missing failure handling for scsi_add_host in aic7xxx driver Jesper Juhl
2005-12-14 4:33 ` James Bottomley [this message]
2005-12-14 8:02 ` Jesper Juhl
2005-12-14 8:20 ` James Bottomley
2005-12-14 8:37 ` Jesper Juhl
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=1134534839.3133.2.camel@mulgrave \
--to=james.bottomley@steeleye.com \
--cc=deischen@iworks.interworks.org \
--cc=dledford@redhat.com \
--cc=jesper.juhl@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
/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