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: <836861fb-c9fd-4bb4-86c0-9d39d29f6bab@web.de>
Date: Fri, 31 Oct 2025 19:09:48 +0100
From: Markus Elfring <Markus.Elfring@....de>
To: linux-fpga@...r.kernel.org, Alan Tull <atull@...nel.org>,
 Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
 Moritz Fischer <mdf@...nel.org>, Richard Gong <richard.gong@...el.com>,
 Tom Rix <trix@...hat.com>, Xu Yilun <yilun.xu@...el.com>
Cc: LKML <linux-kernel@...r.kernel.org>, kernel-janitors@...r.kernel.org,
 Miaoqian Lin <linmq006@...il.com>
Subject: [PATCH] fpga: stratix10-soc: Use pointer from memcpy() call for
 assignment in s10_send_buf()

From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Fri, 31 Oct 2025 18:58:50 +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>
---
 drivers/fpga/stratix10-soc.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/fpga/stratix10-soc.c b/drivers/fpga/stratix10-soc.c
index 0a295ccf1644..2e1167668ca8 100644
--- a/drivers/fpga/stratix10-soc.c
+++ b/drivers/fpga/stratix10-soc.c
@@ -257,8 +257,7 @@ static int s10_send_buf(struct fpga_manager *mgr, const char *buf, size_t count)
 
 	xfer_sz = count < SVC_BUF_SIZE ? count : SVC_BUF_SIZE;
 
-	svc_buf = priv->svc_bufs[i].buf;
-	memcpy(svc_buf, buf, xfer_sz);
+	svc_buf = memcpy(priv->svc_bufs[i].buf, buf, xfer_sz);
 	ret = s10_svc_send_msg(priv, COMMAND_RECONFIG_DATA_SUBMIT,
 			       svc_buf, xfer_sz);
 	if (ret < 0) {
-- 
2.51.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ