[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <acf8f865-4c41-00b5-12d3-26b9d9b4ee34@web.de>
Date: Sat, 7 Jan 2017 20:59:45 +0100
From: Markus Elfring <Markus.Elfring@....de>
To: Maxim Levitsky <maximlevitsky@...il.com>,
kernel-janitors@...r.kernel.org
Cc: LKML <linux-kernel@...r.kernel.org>
Subject: [PATCH 7/9] memstick: Improve another size determination in
msb_read_boot_blocks()
From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Sat, 7 Jan 2017 20:00:16 +0100
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.
Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
drivers/memstick/core/ms_block.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/memstick/core/ms_block.c b/drivers/memstick/core/ms_block.c
index a30c0ae95ae5..98ab5764050b 100644
--- a/drivers/memstick/core/ms_block.c
+++ b/drivers/memstick/core/ms_block.c
@@ -1202,7 +1202,7 @@ static int msb_read_boot_blocks(struct msb_data *msb)
dbg_verbose("Start of a scan for the boot blocks");
if (!msb->boot_page) {
- page = kmalloc(sizeof(struct ms_boot_page)*2, GFP_KERNEL);
+ page = kmalloc(sizeof(*page) * 2, GFP_KERNEL);
if (!page)
return -ENOMEM;
--
2.11.0
Powered by blists - more mailing lists