[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20191030010328.10203-7-jroi.martin@gmail.com>
Date: Wed, 30 Oct 2019 02:03:28 +0100
From: Roi Martin <jroi.martin@...il.com>
To: valdis.kletnieks@...edu
Cc: gregkh@...uxfoundation.org, devel@...verdev.osuosl.org,
linux-kernel@...r.kernel.org, Roi Martin <jroi.martin@...il.com>
Subject: [PATCH 6/6] staging: exfat: replace kmalloc with kmalloc_array
Replace expressions of the form:
kmalloc(count * size, GFP_KERNEL);
With:
kmalloc_array(count, size, GFP_KERNEL);
Signed-off-by: Roi Martin <jroi.martin@...il.com>
---
drivers/staging/exfat/exfat_core.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/exfat/exfat_core.c b/drivers/staging/exfat/exfat_core.c
index f446e6e6c4ee..a9391f0b8141 100644
--- a/drivers/staging/exfat/exfat_core.c
+++ b/drivers/staging/exfat/exfat_core.c
@@ -713,8 +713,8 @@ static s32 __load_upcase_table(struct super_block *sb, sector_t sector,
u32 checksum = 0;
- upcase_table = p_fs->vol_utbl = kmalloc(UTBL_COL_COUNT * sizeof(u16 *),
- GFP_KERNEL);
+ upcase_table = kmalloc_array(UTBL_COL_COUNT, sizeof(u16 *), GFP_KERNEL);
+ p_fs->vol_utbl = upcase_table;
if (!upcase_table)
return FFS_MEMORYERR;
memset(upcase_table, 0, UTBL_COL_COUNT * sizeof(u16 *));
@@ -793,8 +793,8 @@ static s32 __load_default_upcase_table(struct super_block *sb)
u16 uni = 0;
u16 **upcase_table;
- upcase_table = p_fs->vol_utbl = kmalloc(UTBL_COL_COUNT * sizeof(u16 *),
- GFP_KERNEL);
+ upcase_table = kmalloc_array(UTBL_COL_COUNT, sizeof(u16 *), GFP_KERNEL);
+ p_fs->vol_utbl = upcase_table;
if (!upcase_table)
return FFS_MEMORYERR;
memset(upcase_table, 0, UTBL_COL_COUNT * sizeof(u16 *));
--
2.20.1
Powered by blists - more mailing lists