Skip to content

Commit b98e199

Browse files
Dan Carpentercomputersforpeace
authored andcommitted
mtd: oxnas_nand: Allocating more than necessary in probe()
We only need to allocate sizeof(struct oxnas_nand_ctrl) which is 192 bytes and not sizeof(struct nand_chip) which is a much larger 3056 bytes. Fixes: 6685924 ("mtd: nand: Add OX820 NAND Support") Signed-off-by: Dan Carpenter <[email protected]> Acked-by: Neil Armstrong <[email protected]> Acked-by: Boris Brezillon <[email protected]> Signed-off-by: Brian Norris <[email protected]>
1 parent 4ca41cb commit b98e199

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/mtd/nand/oxnas_nand.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ static int oxnas_nand_probe(struct platform_device *pdev)
9191
int err = 0;
9292

9393
/* Allocate memory for the device structure (and zero it) */
94-
oxnas = devm_kzalloc(&pdev->dev, sizeof(struct nand_chip),
94+
oxnas = devm_kzalloc(&pdev->dev, sizeof(*oxnas),
9595
GFP_KERNEL);
9696
if (!oxnas)
9797
return -ENOMEM;

0 commit comments

Comments
 (0)