Skip to content

Commit 0d9a416

Browse files
elfringmiquelraynal
authored andcommitted
mtd: ssfdc: Improve a size determination in ssfdcr_add_mtd()
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@users.sourceforge.net> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/b7ee7d1b-49a2-41d8-9c8f-3674f1aecc43@web.de
1 parent 086cd7a commit 0d9a416

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/mtd/ssfdc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ static void ssfdcr_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd)
295295
if (cis_sector == -1)
296296
return;
297297

298-
ssfdc = kzalloc(sizeof(struct ssfdcr_record), GFP_KERNEL);
298+
ssfdc = kzalloc(sizeof(*ssfdc), GFP_KERNEL);
299299
if (!ssfdc)
300300
return;
301301

0 commit comments

Comments
 (0)