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]
Message-ID: <2f7c926a-6a23-4b60-b905-859645026e4a@web.de>
Date: Thu, 30 Oct 2025 20:38:47 +0100
From: Markus Elfring <Markus.Elfring@....de>
To: linux-mips@...r.kernel.org, "David S. Miller" <davem@...emloft.net>,
 Florian Fainelli <florian@...nwrt.org>, Maxime Bizon <mbizon@...ebox.fr>,
 Thomas Bogendörfer <tsbogend@...ha.franken.de>
Cc: LKML <linux-kernel@...r.kernel.org>, kernel-janitors@...r.kernel.org,
 Miaoqian Lin <linmq006@...il.com>
Subject: [PATCH] MIPS: BCM63xx: Use pointer from memcpy() call for assignment
 in bcm63xx_enet_register()

From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Thu, 30 Oct 2025 20:32:07 +0100

A pointer was assigned to a variable. The same pointer was used for
the destination parameter of a memcpy() call.
This function is documented in the way that the same value is returned.
Thus convert two separate statements into a direct variable assignment for
the return value from a memory copy action.

The source code was transformed by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
 arch/mips/bcm63xx/dev-enet.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/mips/bcm63xx/dev-enet.c b/arch/mips/bcm63xx/dev-enet.c
index 8e73d65f3480..7a17135e8f13 100644
--- a/arch/mips/bcm63xx/dev-enet.c
+++ b/arch/mips/bcm63xx/dev-enet.c
@@ -243,8 +243,7 @@ int __init bcm63xx_enet_register(int unit,
 	}
 
 	/* copy given platform data */
-	dpd = pdev->dev.platform_data;
-	memcpy(dpd, pd, sizeof(*pd));
+	dpd = memcpy(pdev->dev.platform_data, pd, sizeof(*pd));
 
 	/* adjust them in case internal phy is used */
 	if (dpd->use_internal_phy) {
-- 
2.51.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ