From: "Nicholas A. Bellinger" <nab@linux-iscsi.org>
To: Roland Dreier <rdreier@cisco.com>
Cc: linux-kernel@vger.kernel.org, linux-scsi <linux-scsi@vger.kernel.org>
Subject: Re: [PATCH] [SCSI] target: Fix memory leak on error path
Date: Sat, 15 Jan 2011 23:09:11 -0800 [thread overview]
Message-ID: <1295161751.22813.20.camel@haakon2.linux-iscsi.org> (raw)
In-Reply-To: <ada1v4d1k1j.fsf@cisco.com>
On Sat, 2011-01-15 at 21:42 -0800, Roland Dreier wrote:
> If allocation of pt->pscsi_cdb fails, we need to free the just-allocated
> pt or else it will be leaked.
>
> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Good catch here. Committed as dea3bdb0081 and pushed into
lio-core-2.6.git/linus-38-rc1 and scsi-post-merge-2.6.git/for-jejb.
Thanks Roland!
--nab
> ---
> drivers/target/target_core_pscsi.c | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/target/target_core_pscsi.c b/drivers/target/target_core_pscsi.c
> index 742d246..60a2509 100644
> --- a/drivers/target/target_core_pscsi.c
> +++ b/drivers/target/target_core_pscsi.c
> @@ -817,6 +817,7 @@ pscsi_alloc_task(struct se_cmd *cmd)
> if (!(pt->pscsi_cdb)) {
> printk(KERN_ERR "pSCSI: Unable to allocate extended"
> " pt->pscsi_cdb\n");
> + kfree(pt);
> return NULL;
> }
> } else
> --
> 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/
prev parent reply other threads:[~2011-01-16 7:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-16 5:42 Roland Dreier
2011-01-16 7:09 ` Nicholas A. Bellinger [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=1295161751.22813.20.camel@haakon2.linux-iscsi.org \
--to=nab@linux-iscsi.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=rdreier@cisco.com \
/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®