[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <a684cb0b-b478-b64e-e1d8-fe18a45d9885@users.sourceforge.net>
Date: Fri, 15 Sep 2017 22:42:49 +0200
From: SF Markus Elfring <elfring@...rs.sourceforge.net>
To: linux-media@...r.kernel.org,
Alexey Klimov <klimov.linux@...il.com>,
Mauro Carvalho Chehab <mchehab@...nel.org>
Cc: LKML <linux-kernel@...r.kernel.org>,
kernel-janitors@...r.kernel.org
Subject: [PATCH 2/2] [media] ma901: Improve a size determination in
usb_ma901radio_probe()
From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Fri, 15 Sep 2017 22:23:42 +0200
Replace the specification of a data structure by a pointer dereference
as the parameter for the operator "sizeof" to make the corresponding size
determination a bit safer according to the Linux coding style convention.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
drivers/media/radio/radio-ma901.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/radio/radio-ma901.c b/drivers/media/radio/radio-ma901.c
index c386fbd63703..61d1657f1ee7 100644
--- a/drivers/media/radio/radio-ma901.c
+++ b/drivers/media/radio/radio-ma901.c
@@ -357,5 +357,5 @@ static int usb_ma901radio_probe(struct usb_interface *intf,
|| strncmp(dev->manufacturer, "www.masterkit.ru", 16) != 0))
return -ENODEV;
- radio = kzalloc(sizeof(struct ma901radio_device), GFP_KERNEL);
+ radio = kzalloc(sizeof(*radio), GFP_KERNEL);
if (!radio) {
--
2.14.1
Powered by blists - more mailing lists