[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1476376177.2164.10.camel@perches.com>
Date: Thu, 13 Oct 2016 09:29:37 -0700
From: Joe Perches <joe@...ches.com>
To: SF Markus Elfring <elfring@...rs.sourceforge.net>,
linux-media@...r.kernel.org, Hans Verkuil <hverkuil@...all.nl>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
Sean Young <sean@...s.org>,
Wolfram Sang <wsa-dev@...g-engineering.com>
Cc: LKML <linux-kernel@...r.kernel.org>,
kernel-janitors@...r.kernel.org,
Julia Lawall <julia.lawall@...6.fr>
Subject: Re: [PATCH 01/18] [media] RedRat3: Use kcalloc() in two functions
On Thu, 2016-10-13 at 18:18 +0200, SF Markus Elfring wrote:
> diff --git a/drivers/media/rc/redrat3.c b/drivers/media/rc/redrat3.c
[]
> @@ -549,7 +549,7 @@ static void redrat3_get_firmware_rev(struct redrat3_dev *rr3)
> int rc = 0;
> char *buffer;
>
> - buffer = kzalloc(sizeof(char) * (RR3_FW_VERSION_LEN + 1), GFP_KERNEL);
> + buffer = kcalloc(RR3_FW_VERSION_LEN + 1, sizeof(*buffer), GFP_KERNEL);
> if (!buffer) {
> dev_err(rr3->dev, "Memory allocation failure\n");
> return;,
Markus, please stop being _so_ mechanical and use your
brain a little too. By definition, sizeof(char) == 1.
This _really_ should be kzalloc(RR3_FW_VERSION_LEN + 1,...)
Powered by blists - more mailing lists