LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Bharath Vedartham <linux.bhar@gmail.com>
To: Joe Perches <joe@perches.com>
Cc: sathya.prakash@broadcom.com, chaitra.basappa@broadcom.com,
	MPT-FusionLinux.pdl@broadcom.com, linux-scsi@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] message/fusion/mptbase.c: Use kmemdup instead of memcpy and kmalloc
Date: Wed, 22 May 2019 21:26:57 +0530	[thread overview]
Message-ID: <20190522155657.GA12887@bharath12345-Inspiron-5559> (raw)
In-Reply-To: <7e2a727333d1d764ae3c0099e050a0521e87d9d8.camel@perches.com>

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

      reply	other threads:[~2019-05-22 15:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-22  9:53 Bharath Vedartham
2019-05-22 11:48 ` Joe Perches
2019-05-22 15:56   ` Bharath Vedartham [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190522155657.GA12887@bharath12345-Inspiron-5559 \
    --to=linux.bhar@gmail.com \
    --cc=MPT-FusionLinux.pdl@broadcom.com \
    --cc=chaitra.basappa@broadcom.com \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=sathya.prakash@broadcom.com \
    --subject='Re: [PATCH] message/fusion/mptbase.c: Use kmemdup instead of memcpy and kmalloc' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).