lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:   Sat, 28 Apr 2018 09:23:19 +0200 (CEST)
From:   Julia Lawall <julia.lawall@...6.fr>
To:     Sujeev Dias <sdias@...eaurora.org>
cc:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Arnd Bergmann <arnd@...db.de>,
        Sujeev Dias <sdias@...eaurora.org>,
        linux-kernel@...r.kernel.org, linux-arm-msm@...r.kernel.org,
        Tony Truong <truong@...eaurora.org>, kbuild-all@...org
Subject: [PATCH] mhi_bus: core: fix memdup.cocci warnings

From: Fengguang Wu <fengguang.wu@...el.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@...eaurora.org>
Signed-off-by: Fengguang Wu <fengguang.wu@...el.com>
Signed-off-by: Julia Lawall <julia.lawall@...6.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);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ