From: Dan Carpenter <error27@gmail.com>
To: Jesper Juhl <jj@chaosbits.net>
Cc: "Nicholas A. Bellinger" <nab@linux-iscsi.org>,
James Bottomley <jbottomley@parallels.com>,
Christoph Hellwig <hch@lst.de>,
linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH][Resend] SCSI, target, loopback: Fix memory leak in tcm_loop_make_scsi_hba()
Date: Tue, 28 Jun 2011 01:25:26 +0300 [thread overview]
Message-ID: <20110627222526.GA14591@shale.localdomain> (raw)
In-Reply-To: <alpine.LNX.2.00.1106272351520.30245@swampdragon.chaosbits.net>
On Mon, Jun 27, 2011 at 11:54:48PM +0200, Jesper Juhl wrote:
> --- a/drivers/target/loopback/tcm_loop.c
> +++ b/drivers/target/loopback/tcm_loop.c
> @@ -1321,7 +1321,8 @@ struct se_wwn *tcm_loop_make_scsi_hba(
>
> printk(KERN_ERR "Unable to locate prefix for emulated Target Port:"
> " %s\n", name);
> - return ERR_PTR(-EINVAL);
> + ret = -EINVAL;
> + goto out;
You've added a weird bunny hop goto here. It might be better to
change the if (ptr) check to if (!ptr) so we could fall through
here in the normal case.
>
> check_len:
> if (strlen(name) >= TL_WWN_ADDR_LEN) {
If this check fails then it calls kfree() and returns. It would be
cleaner to "goto out" here as well.
regards,
dan carpenter
next prev parent reply other threads:[~2011-06-27 22:27 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-27 21:54 Jesper Juhl
2011-06-27 22:25 ` Dan Carpenter [this message]
2011-06-27 22:30 ` Jesper Juhl
2011-06-28 6:22 ` Dan Carpenter
2011-07-17 20:59 ` Nicholas A. Bellinger
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=20110627222526.GA14591@shale.localdomain \
--to=error27@gmail.com \
--cc=hch@lst.de \
--cc=jbottomley@parallels.com \
--cc=jj@chaosbits.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=nab@linux-iscsi.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
all inboxes | Powered by JetHome®