LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Bharath Vedartham <linux.bhar@gmail.com>,
sathya.prakash@broadcom.com, chaitra.basappa@broadcom.com
Cc: 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 04:48:33 -0700 [thread overview]
Message-ID: <7e2a727333d1d764ae3c0099e050a0521e87d9d8.camel@perches.com> (raw)
In-Reply-To: <20190522095335.GA3212@bharath12345-Inspiron-5559>
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.
next prev parent reply other threads:[~2019-05-22 11:48 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 [this message]
2019-05-22 15:56 ` Bharath Vedartham
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=7e2a727333d1d764ae3c0099e050a0521e87d9d8.camel@perches.com \
--to=joe@perches.com \
--cc=MPT-FusionLinux.pdl@broadcom.com \
--cc=chaitra.basappa@broadcom.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=linux.bhar@gmail.com \
--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).