[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e4cf3adb-0a9b-c412-0720-944a9dfd0ffc@users.sourceforge.net>
Date: Wed, 30 Aug 2017 09:22:07 +0200
From: SF Markus Elfring <elfring@...rs.sourceforge.net>
To: linux-media@...r.kernel.org,
Mauro Carvalho Chehab <mchehab@...nel.org>,
Max Kellermann <max.kellermann@...il.com>
Cc: LKML <linux-kernel@...r.kernel.org>,
kernel-janitors@...r.kernel.org
Subject: [PATCH 4/6] [media] cx24116: Improve a size determination in
cx24116_attach()
From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Wed, 30 Aug 2017 08:15:33 +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/dvb-frontends/cx24116.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/dvb-frontends/cx24116.c b/drivers/media/dvb-frontends/cx24116.c
index 54f09a5a5075..74d610207bf2 100644
--- a/drivers/media/dvb-frontends/cx24116.c
+++ b/drivers/media/dvb-frontends/cx24116.c
@@ -1123,7 +1123,7 @@ struct dvb_frontend *cx24116_attach(const struct cx24116_config *config,
dprintk("%s\n", __func__);
/* allocate memory for the internal state */
- state = kzalloc(sizeof(struct cx24116_state), GFP_KERNEL);
+ state = kzalloc(sizeof(*state), GFP_KERNEL);
if (state == NULL)
goto error1;
--
2.14.1
Powered by blists - more mailing lists