[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1395846982.3726.18.camel@joe-AO722>
Date: Wed, 26 Mar 2014 08:16:22 -0700
From: Joe Perches <joe@...ches.com>
To: Jimmy Li <coder.liss@...il.com>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Teodora Baluta <teobaluta@...il.com>,
Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@...el.com>,
Michael Gunselmann <michael.gunselmann@...dium.uni-erlangen.de>,
Lisa Nguyen <lisa@...apiadmin.com>,
Martin Hofmann <martin.hofmann@...dium.uni-erlangen.de>,
Malcolm Priestley <tvboxspy@...il.com>,
Tülin İzer <tulinizer@...il.com>,
Archana kumari <archanakumari959@...il.com>,
devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] drivers/staging/vt6655/iwctl.c fix a sparse warning
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists