lkml.org 
[lkml]   [2014]   [Mar]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] drivers/staging/vt6655/iwctl.c fix a sparse warning
From
Date
On Wed, 2014-03-26 at 00:42 -0700, Jimmy Li wrote:
> fix a sparse warning.
[]
> diff --git a/drivers/staging/vt6655/iwctl.c b/drivers/staging/vt6655/iwctl.c
[]
> @@ -1843,7 +1843,7 @@ int iwctl_siwencodeext(struct net_device *dev,
[]
> blen = sizeof(*param);
> - buf = kmalloc((int)blen, (int)GFP_KERNEL);
> + buf = kmalloc((int)blen, GFP_KERNEL);
> if (buf == NULL)
> return -ENOMEM;
> memset(buf, 0, blen);

Ideally, this would be

buf = kzalloc(sizeof(*param), GFP_KERNEL);
if (!buf)
return -ENOMEM;

removing the now unused blen variable declaration
and without the now unnecessary memset




\
 
 \ /
  Last update: 2014-03-26 17:01    [W:0.073 / U:1.004 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site