summaryrefslogtreecommitdiffstats
path: root/drivers/staging/lustre
diff options
context:
space:
mode:
authorSumit Pundir <pundirsumit11@gmail.com>2018-01-20 13:26:09 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-01-22 11:40:49 +0100
commit142ad642cde315764c4d8589fc0ed5bf67a712e9 (patch)
treef0a08d0a81a7a9a4a7d2bcc4e7bdb6693c6c8fe9 /drivers/staging/lustre
parent99c7d99f1a7f6cec15004073f0a900c361010991 (diff)
downloadlinux-stable-142ad642cde315764c4d8589fc0ed5bf67a712e9.tar.gz
linux-stable-142ad642cde315764c4d8589fc0ed5bf67a712e9.tar.bz2
linux-stable-142ad642cde315764c4d8589fc0ed5bf67a712e9.zip
staging: lustre: lnet: prefer kcalloc over kzalloc with multiply
Use kcalloc for allocating an array instead of kzalloc with multiply. kcalloc is the preferred API. Issue reported by checkpatch.pl Signed-off-by: Sumit Pundir <pundirsumit11@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/lustre')
-rw-r--r--drivers/staging/lustre/lnet/lnet/config.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/lustre/lnet/lnet/config.c b/drivers/staging/lustre/lnet/lnet/config.c
index 1516ac61108d..0aea268a4f1c 100644
--- a/drivers/staging/lustre/lnet/lnet/config.c
+++ b/drivers/staging/lustre/lnet/lnet/config.c
@@ -1146,7 +1146,7 @@ lnet_ipaddr_enumerate(__u32 **ipaddrsp)
if (nif <= 0)
return nif;
- ipaddrs = kzalloc(nif * sizeof(*ipaddrs), GFP_KERNEL);
+ ipaddrs = kcalloc(nif, sizeof(*ipaddrs), GFP_KERNEL);
if (!ipaddrs) {
CERROR("Can't allocate ipaddrs[%d]\n", nif);
lnet_ipif_free_enumeration(ifnames, nif);
@@ -1179,7 +1179,7 @@ lnet_ipaddr_enumerate(__u32 **ipaddrsp)
*ipaddrsp = ipaddrs;
} else {
if (nip > 0) {
- ipaddrs2 = kzalloc(nip * sizeof(*ipaddrs2),
+ ipaddrs2 = kcalloc(nip, sizeof(*ipaddrs2),
GFP_KERNEL);
if (!ipaddrs2) {
CERROR("Can't allocate ipaddrs[%d]\n", nip);