lkml.org 
[lkml]   [2019]   [May]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] message/fusion/mptbase.c: Use kmemdup instead of memcpy and kmalloc
On Wed, May 22, 2019 at 04:48:33AM -0700, Joe Perches wrote:
> 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.
>
>
Yes! I will change this in v2.

Thanks
Bharath

\
 
 \ /
  Last update: 2019-05-22 17:58    [W:0.054 / U:1.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site