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: <20250407131110.2394-1-vulab@iscas.ac.cn>
Date: Mon,  7 Apr 2025 21:11:10 +0800
From: Wentao Liang <vulab@...as.ac.cn>
To: ecree.xilinx@...il.com,
	habetsm.xilinx@...il.com,
	andrew+netdev@...n.ch,
	davem@...emloft.net,
	edumazet@...gle.com,
	kuba@...nel.org,
	pabeni@...hat.com
Cc: netdev@...r.kernel.org,
	linux-staging@...ts.linux.dev,
	linux-net-drivers@....com,
	linux-kernel@...r.kernel.org,
	Wentao Liang <vulab@...as.ac.cn>,
	stable@...r.kernel.org
Subject: [PATCH v2] sfc: Propagate the return value of devlink_info_serial_number_put()

The function efx_devlink_info_board_cfg() calls the function
devlink_info_serial_number_put(), but does not check its return
value.

Return the error code if either the devlink_info_serial_number_put()
or the efx_mcdi_get_board_cfg() fails.The control flow of the code is
changed a little bit to simplify the code. The functionality of the
code remain the same.

Fixes: 14743ddd2495 ("sfc: add devlink info support for ef100")
Cc: stable@...r.kernel.org # v6.3+
Signed-off-by: Wentao Liang <vulab@...as.ac.cn>
---
v2: Simplify code logic.

 drivers/net/ethernet/sfc/efx_devlink.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/sfc/efx_devlink.c b/drivers/net/ethernet/sfc/efx_devlink.c
index 3cd750820fdd..53b17cd252c8 100644
--- a/drivers/net/ethernet/sfc/efx_devlink.c
+++ b/drivers/net/ethernet/sfc/efx_devlink.c
@@ -584,11 +584,12 @@ static int efx_devlink_info_board_cfg(struct efx_nic *efx,
 	int rc;
 
 	rc = efx_mcdi_get_board_cfg(efx, (u8 *)mac_address, NULL, NULL);
-	if (!rc) {
-		snprintf(sn, EFX_MAX_SERIALNUM_LEN, "%pm", mac_address);
-		devlink_info_serial_number_put(req, sn);
-	}
-	return rc;
+	if (rc)
+		return rc;
+
+	snprintf(sn, EFX_MAX_SERIALNUM_LEN, "%pm", mac_address);
+
+	return devlink_info_serial_number_put(req, sn);
 }
 
 static int efx_devlink_info_get(struct devlink *devlink,
-- 
2.42.0.windows.2


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ