Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1500444 > unrolled thread

[PATCH 08/18] [media] RedRat3: Improve another size determination in redrat3_send_cmd()

Started bySF Markus Elfring <elfring@users.sourceforge.net>
First post2016-10-13 18:40 +0200
Last post2016-10-13 18:40 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 08/18] [media] RedRat3: Improve another size determination in  redrat3_send_cmd() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-13 18:40 +0200

#1500444 — [PATCH 08/18] [media] RedRat3: Improve another size determination in redrat3_send_cmd()

FromSF Markus Elfring <elfring@users.sourceforge.net>
Date2016-10-13 18:40 +0200
Subject[PATCH 08/18] [media] RedRat3: Improve another size determination in redrat3_send_cmd()
Message-ID<srRd0-5TH-53@gated-at.bofh.it>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Thu, 13 Oct 2016 13:31:17 +0200

Replace the specification of a data type by a pointer dereference
as the parameter for the operator "sizeof" to make the corresponding size
determination a bit safer.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/media/rc/redrat3.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/rc/redrat3.c b/drivers/media/rc/redrat3.c
index 5832e6f..f6c21a1 100644
--- a/drivers/media/rc/redrat3.c
+++ b/drivers/media/rc/redrat3.c
@@ -388,7 +388,7 @@ static int redrat3_send_cmd(int cmd, struct redrat3_dev *rr3)
 	u8 *data;
 	int res;
 
-	data = kzalloc(sizeof(u8), GFP_KERNEL);
+	data = kzalloc(sizeof(*data), GFP_KERNEL);
 	if (!data)
 		return -ENOMEM;
 
-- 
2.10.1

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web