From: Boaz Harrosh <bharrosh@panasas.com>
To: Dan Carpenter <dan.carpenter@oracle.com>,
"James E.J. Bottomley" <JBottomley@parallels.com>
Cc: Benny Halevy <bhalevy@tonian.com>,
osd-dev@open-osd.org, linux-scsi@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: Re: [patch] [SCSI] libosd: check for kzalloc() failure
Date: Wed, 30 Jan 2013 15:56:13 +0000 [thread overview]
Message-ID: <5109429D.1080802@panasas.com> (raw)
In-Reply-To: <20130130070602.GB12396@elgon.mountain>
On 01/30/2013 09:06 AM, Dan Carpenter wrote:
> There wasn't any error handling for this kzalloc().
>
ACK-by: Boaz Harrosh <bharrosh@panasas.com>
James please queue for inclusion
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Thanks Dan
>
> diff --git a/drivers/scsi/osd/osd_initiator.c b/drivers/scsi/osd/osd_initiator.c
> index c06b8e5..d8293f2 100644
> --- a/drivers/scsi/osd/osd_initiator.c
> +++ b/drivers/scsi/osd/osd_initiator.c
> @@ -144,6 +144,10 @@ static int _osd_get_print_system_info(struct osd_dev *od,
> odi->osdname_len = get_attrs[a].len;
> /* Avoid NULL for memcmp optimization 0-length is good enough */
> odi->osdname = kzalloc(odi->osdname_len + 1, GFP_KERNEL);
> + if (!odi->osdname) {
> + ret = -ENOMEM;
> + goto out;
> + }
> if (odi->osdname_len)
> memcpy(odi->osdname, get_attrs[a].val_ptr, odi->osdname_len);
> OSD_INFO("OSD_NAME [%s]\n", odi->osdname);
>
prev parent reply other threads:[~2013-01-30 15:56 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-30 7:06 [patch] [SCSI] libosd: check for kzalloc() failure Dan Carpenter
2013-01-30 8:15 ` walter harms
2013-01-30 8:27 ` Dan Carpenter
2013-01-30 8:57 ` walter harms
2013-01-30 9:51 ` Benny Halevy
2013-01-30 13:00 ` walter harms
2013-01-30 13:40 ` Benny Halevy
2013-01-30 14:34 ` walter harms
2013-01-30 15:51 ` Boaz Harrosh
2013-01-30 10:05 ` Benny Halevy
2013-01-30 15:56 ` Boaz Harrosh [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=5109429D.1080802@panasas.com \
--to=bharrosh@panasas.com \
--cc=JBottomley@parallels.com \
--cc=bhalevy@tonian.com \
--cc=dan.carpenter@oracle.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=osd-dev@open-osd.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