LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] mhi_bus: core: fix memdup.cocci warnings
@ 2018-04-28 7:23 Julia Lawall
0 siblings, 0 replies; only message in thread
From: Julia Lawall @ 2018-04-28 7:23 UTC (permalink / raw)
To: Sujeev Dias
Cc: Greg Kroah-Hartman, Arnd Bergmann, Sujeev Dias, linux-kernel,
linux-arm-msm, Tony Truong, kbuild-all
From: Fengguang Wu <fengguang.wu@intel.com>
Use kmemdup rather than duplicating its implementation
Generated by: scripts/coccinelle/api/memdup.cocci
Fixes: ec8245f7a36f ("mhi_bus: core: Add support for MHI host interface")
CC: Sujeev Dias <sdias@codeaurora.org>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>
---
url:
https://github.com/0day-ci/linux/commits/Sujeev-Dias/mhi_bus-core-Add-support-for-MHI-host-interface/20180428-065959
:::::: branch date: 3 hours ago
:::::: commit date: 3 hours ago
mhi_boot.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
--- a/drivers/bus/mhi/core/mhi_boot.c
+++ b/drivers/bus/mhi/core/mhi_boot.c
@@ -504,7 +504,7 @@ void mhi_fw_load_worker(struct work_stru
if (size > firmware->size)
size = firmware->size;
- buf = kmalloc(size, GFP_KERNEL);
+ buf = kmemdup(firmware->data, size, GFP_KERNEL);
if (!buf) {
MHI_ERR("Could not allocate memory for image\n");
release_firmware(firmware);
@@ -512,7 +512,6 @@ void mhi_fw_load_worker(struct work_stru
}
/* load sbl image */
- memcpy(buf, firmware->data, size);
ret = mhi_fw_load_sbl(mhi_cntrl, buf, size);
kfree(buf);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2018-04-28 7:23 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-28 7:23 [PATCH] mhi_bus: core: fix memdup.cocci warnings Julia Lawall
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).