diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2017-04-25 05:19:49 -0400 |
---|---|---|
committer | Brian Norris <computersforpeace@gmail.com> | 2017-05-02 18:54:49 -0400 |
commit | b98e1995e4fa9030474a61ed0dbc033464fe5ea0 (patch) | |
tree | 95e86e413ced98cdf304b40e64dc0df4e01b5850 | |
parent | 4ca41cb2ae09bfd9f84f053b8b9966e1bb8accc4 (diff) |
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: 668592492409 ("mtd: nand: Add OX820 NAND Support")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Neil Armstrong <narmstrong@baylibre.com>
Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
-rw-r--r-- | drivers/mtd/nand/oxnas_nand.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mtd/nand/oxnas_nand.c b/drivers/mtd/nand/oxnas_nand.c index 3e3bf3b364d2..1b207aac840c 100644 --- a/drivers/mtd/nand/oxnas_nand.c +++ b/drivers/mtd/nand/oxnas_nand.c | |||
@@ -91,7 +91,7 @@ static int oxnas_nand_probe(struct platform_device *pdev) | |||
91 | int err = 0; | 91 | int err = 0; |
92 | 92 | ||
93 | /* Allocate memory for the device structure (and zero it) */ | 93 | /* 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), |
95 | GFP_KERNEL); | 95 | GFP_KERNEL); |
96 | if (!oxnas) | 96 | if (!oxnas) |
97 | return -ENOMEM; | 97 | return -ENOMEM; |