From: Dan Carpenter <dan.carpenter@oracle.com>
To: kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] staging: wlags49_h2: Replace kmalloc+memset by kzalloc and add error handling.
Date: Fri, 23 Mar 2012 10:40:29 +0000 [thread overview]
Message-ID: <20120323104029.GF3232@mwanda> (raw)
In-Reply-To: <20120323095158.GB3181@mwanda>
[-- Attachment #1: Type: text/plain, Size: 998 bytes --]
On Fri, Mar 23, 2012 at 03:27:10PM +0530, santosh prasad nayak wrote:
> On Fri, Mar 23, 2012 at 3:21 PM, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> > On Fri, Mar 23, 2012 at 03:11:45PM +0530, santosh nayak wrote:
> >> - dev_wds = kmalloc( sizeof( struct net_device ), GFP_KERNEL );
> >> - memset( dev_wds, 0, sizeof( struct net_device ));
> >> + dev_wds = kzalloc(sizeof(struct net_device), GFP_KERNEL);
> >> + if (unlikely(!dev_wds)) {
> >> + printk(KERN_ERR "%s: failed to alloc memory\n", __func__);
> >
> > Don't resend, but kmalloc() already prints out way more extensive
> > and useful error messages than this. No need to print an error
> > message yourself normally.
> >
>
> Do you mean in the following format ?
>
> + if (unlikely(!dev_wds)) {
> + DBG_LEAVE(DbgInfo);
> + return;
> + }
No need to resend. It's just for next time something to consider.
regards,
dan carpenter
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2012-03-23 10:40 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-23 9:51 [PATCH] staging: wlags49_h2: Replace kmalloc+memset by kzalloc and add error handling Dan Carpenter
2012-03-23 9:53 ` santosh nayak
2012-03-23 9:58 ` santosh prasad nayak
2012-03-23 10:40 ` Dan Carpenter [this message]
2012-03-23 14:56 ` Greg KH
2012-03-23 15:41 ` Greg KH
2012-03-23 15:42 ` santosh prasad nayak
2012-03-27 20:53 ` Ezequiel García
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=20120323104029.GF3232@mwanda \
--to=dan.carpenter@oracle.com \
--cc=kernel-janitors@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.