[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7e2a727333d1d764ae3c0099e050a0521e87d9d8.camel@perches.com>
Date: Wed, 22 May 2019 04:48:33 -0700
From: Joe Perches <joe@...ches.com>
To: Bharath Vedartham <linux.bhar@...il.com>,
sathya.prakash@...adcom.com, chaitra.basappa@...adcom.com
Cc: MPT-FusionLinux.pdl@...adcom.com, linux-scsi@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] message/fusion/mptbase.c: Use kmemdup instead of memcpy
and kmalloc
On Wed, 2019-05-22 at 15:23 +0530, Bharath Vedartham wrote:
> Replace kmalloc + memcpy with kmemdup.
> This was reported by coccinelle.
[]
> diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c
[]
> @@ -6001,13 +6001,12 @@ mpt_findImVolumes(MPT_ADAPTER *ioc)
> if (mpt_config(ioc, &cfg) != 0)
> goto out;
>
> - mem = kmalloc(iocpage2sz, GFP_KERNEL);
> + mem = kmemdup((u8 *)pIoc2, iocpage2sz, GFP_KERNEL);
You should remove the unnecessary cast here.
Powered by blists - more mailing lists