From: Jiri Slaby <jirislaby@gmail.com>
To: wharms@bfs.de
Cc: Kulikov Vasiliy <segooon@gmail.com>,
devel@driverdev.osuosl.org, Greg Kroah-Hartman <gregkh@suse.de>,
kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org,
Tejun Heo <tj@kernel.org>
Subject: Re: [PATCH 3/9] staging: otus: check kmalloc() return value
Date: Fri, 30 Jul 2010 14:49:25 +0200 [thread overview]
Message-ID: <4C52CA55.4000204@gmail.com> (raw)
In-Reply-To: <4C52C614.4030803@bfs.de>
On 07/30/2010 02:31 PM, walter harms wrote:
>
>
> Kulikov Vasiliy schrieb:
>> kmalloc() may fail, if so return error from zfwUsbSubmitControl().
>>
>> Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
>> ---
>> drivers/staging/otus/wrap_usb.c | 5 +++++
>> 1 files changed, 5 insertions(+), 0 deletions(-)
>>
>> diff --git a/drivers/staging/otus/wrap_usb.c b/drivers/staging/otus/wrap_usb.c
>> index 93459ca..9f04047 100644
>> --- a/drivers/staging/otus/wrap_usb.c
>> +++ b/drivers/staging/otus/wrap_usb.c
>> @@ -104,6 +104,11 @@ u32_t zfwUsbSubmitControl(zdev_t *dev, u8_t req, u16_t value, u16_t index,
>>
>> if (size > 0) {
>> buf = kmalloc(size, GFP_KERNEL);
>> + if (buf == NULL) {
>> + pr_err("zfwUsbSubmitControl() failed, "
>> + "kmalloc() returned NULL\n");
>> + return 1;
>> + }
>> memcpy(buf, (u8_t *)data, size);
>> } else
>> buf = NULL;
>
>
> We had a memdup() somewhere had'nt we ?
Yes, but it is not what he is changing. (Patches welcome.)
The patch is OK, except try to avoid function names in printks next
time. Function names are constantly changing, but developers tend not to
change printk strings. (%s + __func__)
regards,
--
js
next prev parent reply other threads:[~2010-07-30 12:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-30 11:08 [PATCH 3/9] staging: otus: check kmalloc() return value Kulikov Vasiliy
2010-07-30 12:31 ` walter harms
2010-07-30 12:49 ` Jiri Slaby [this message]
2010-07-30 14:07 ` Dan Carpenter
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=4C52CA55.4000204@gmail.com \
--to=jirislaby@gmail.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@suse.de \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=segooon@gmail.com \
--cc=tj@kernel.org \
--cc=wharms@bfs.de \
/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