[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180704172759.GA33591@beast>
Date: Wed, 4 Jul 2018 10:27:59 -0700
From: Kees Cook <keescook@...omium.org>
To: Boris Brezillon <boris.brezillon@...tlin.com>
Cc: Peter Pan <peterpandong@...ron.com>,
Miquel Raynal <miquel.raynal@...tlin.com>,
linux-mtd@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: [PATCH] mtd: spinand: Use 2-factor allocator calls
As already done treewide, switch from open-coded multiplication to using
2-factor allocator helpers.
Signed-off-by: Kees Cook <keescook@...omium.org>
---
drivers/mtd/nand/spi/core.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c
index 17d207a49cb9..fed9211c6f19 100644
--- a/drivers/mtd/nand/spi/core.c
+++ b/drivers/mtd/nand/spi/core.c
@@ -159,9 +159,9 @@ static int spinand_init_cfg_cache(struct spinand_device *spinand)
unsigned int target;
int ret;
- spinand->cfg_cache = devm_kzalloc(dev,
- sizeof(*spinand->cfg_cache) *
+ spinand->cfg_cache = devm_kcalloc(dev,
nand->memorg.ntargets,
+ sizeof(*spinand->cfg_cache),
GFP_KERNEL);
if (!spinand->cfg_cache)
return -ENOMEM;
--
2.17.1
--
Kees Cook
Pixel Security
Powered by blists - more mailing lists