From: Sumit Pundir Date: Sat, 20 Jan 2018 07:56:09 +0000 (+0530) Subject: staging: lustre: lnet: prefer kcalloc over kzalloc with multiply X-Git-Tag: v4.19~1691^2~34 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=142ad642cde315764c4d8589fc0ed5bf67a712e9;p=platform%2Fkernel%2Flinux-rpi.git 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 Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/lustre/lnet/lnet/config.c b/drivers/staging/lustre/lnet/lnet/config.c index 1516ac6..0aea268 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);