All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] staging: wlags49_h2: Replace kmalloc+memset by kzalloc and add error handling.
@ 2012-03-23  9:51 Dan Carpenter
  2012-03-23  9:53 ` santosh nayak
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Dan Carpenter @ 2012-03-23  9:51 UTC (permalink / raw)
  To: kernel-janitors

[-- Attachment #1: Type: text/plain, Size: 537 bytes --]

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.

regards,
dan carpenter



[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-03-27 20:53 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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.