* [PATCH] mtd: spinand: Use 2-factor allocator calls
@ 2018-07-04 17:27 Kees Cook
2018-07-05 7:03 ` Miquel Raynal
2018-07-08 21:50 ` Miquel Raynal
0 siblings, 2 replies; 4+ messages in thread
From: Kees Cook @ 2018-07-04 17:27 UTC (permalink / raw)
To: Boris Brezillon; +Cc: Peter Pan, Miquel Raynal, linux-mtd, linux-kernel
As already done treewide, switch from open-coded multiplication to using
2-factor allocator helpers.
Signed-off-by: Kees Cook <keescook@chromium.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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] mtd: spinand: Use 2-factor allocator calls
2018-07-04 17:27 [PATCH] mtd: spinand: Use 2-factor allocator calls Kees Cook
@ 2018-07-05 7:03 ` Miquel Raynal
2018-07-05 15:56 ` Kees Cook
2018-07-08 21:50 ` Miquel Raynal
1 sibling, 1 reply; 4+ messages in thread
From: Miquel Raynal @ 2018-07-05 7:03 UTC (permalink / raw)
To: Kees Cook; +Cc: Boris Brezillon, Peter Pan, linux-mtd, linux-kernel
Hello,
Kees Cook <keescook@chromium.org> wrote on Wed, 4 Jul 2018 10:27:59
-0700:
> As already done treewide, switch from open-coded multiplication to using
> 2-factor allocator helpers.
>
> Signed-off-by: Kees Cook <keescook@chromium.org>
> ---
Indeed, we'll be more careful about this in the future.
As this code has not been merged upstream yet, do you mind if I
squash this with the initial patch?
Thanks,
Miquèl
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] mtd: spinand: Use 2-factor allocator calls
2018-07-05 7:03 ` Miquel Raynal
@ 2018-07-05 15:56 ` Kees Cook
0 siblings, 0 replies; 4+ messages in thread
From: Kees Cook @ 2018-07-05 15:56 UTC (permalink / raw)
To: Miquel Raynal; +Cc: Boris Brezillon, Peter Pan, Linux mtd, LKML
On Thu, Jul 5, 2018 at 12:03 AM, Miquel Raynal
<miquel.raynal@bootlin.com> wrote:
> Hello,
>
> Kees Cook <keescook@chromium.org> wrote on Wed, 4 Jul 2018 10:27:59
> -0700:
>
>> As already done treewide, switch from open-coded multiplication to using
>> 2-factor allocator helpers.
>>
>> Signed-off-by: Kees Cook <keescook@chromium.org>
>> ---
>
> Indeed, we'll be more careful about this in the future.
>
> As this code has not been merged upstream yet, do you mind if I
> squash this with the initial patch?
Totally fine by me! Thanks! :)
-Kees
--
Kees Cook
Pixel Security
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] mtd: spinand: Use 2-factor allocator calls
2018-07-04 17:27 [PATCH] mtd: spinand: Use 2-factor allocator calls Kees Cook
2018-07-05 7:03 ` Miquel Raynal
@ 2018-07-08 21:50 ` Miquel Raynal
1 sibling, 0 replies; 4+ messages in thread
From: Miquel Raynal @ 2018-07-08 21:50 UTC (permalink / raw)
To: Kees Cook; +Cc: Boris Brezillon, Peter Pan, linux-mtd, linux-kernel
Hi Kees,
Kees Cook <keescook@chromium.org> wrote on Wed, 4 Jul 2018 10:27:59
-0700:
> As already done treewide, switch from open-coded multiplication to using
> 2-factor allocator helpers.
>
> Signed-off-by: Kees Cook <keescook@chromium.org>
> ---
Merged with the original commit.
Thanks,
Miquèl
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-07-08 21:51 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-04 17:27 [PATCH] mtd: spinand: Use 2-factor allocator calls Kees Cook
2018-07-05 7:03 ` Miquel Raynal
2018-07-05 15:56 ` Kees Cook
2018-07-08 21:50 ` Miquel Raynal
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.