netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] net: mlxsw: linecards: fix missing error check in mlxsw_linecard_devlink_info_get()
@ 2025-11-13 16:19 Pavel Zhigulin
  2025-11-13 19:15 ` Ido Schimmel
  2025-11-15  2:10 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Pavel Zhigulin @ 2025-11-13 16:19 UTC (permalink / raw)
  To: Ido Schimmel
  Cc: Pavel Zhigulin, Petr Machata, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Jiri Pirko, netdev,
	linux-kernel, lvc-project

The call to devlink_info_version_fixed_put() in
mlxsw_linecard_devlink_info_get() did not check for errors,
although it is checked everywhere in the code.

Add missed 'err' check to the mlxsw_linecard_devlink_info_get()

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: 3fc0c51905fb ("mlxsw: core_linecards: Expose device PSID over device info")
Signed-off-by: Pavel Zhigulin <Pavel.Zhigulin@kaspersky.com>
---
 drivers/net/ethernet/mellanox/mlxsw/core_linecards.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_linecards.c b/drivers/net/ethernet/mellanox/mlxsw/core_linecards.c
index b032d5a4b3b8..10f5bc4892fc 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/core_linecards.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/core_linecards.c
@@ -601,6 +601,8 @@ int mlxsw_linecard_devlink_info_get(struct mlxsw_linecard *linecard,
 		err = devlink_info_version_fixed_put(req,
 						     DEVLINK_INFO_VERSION_GENERIC_FW_PSID,
 						     info->psid);
+		if (err)
+			goto unlock;

 		sprintf(buf, "%u.%u.%u", info->fw_major, info->fw_minor,
 			info->fw_sub_minor);
--
2.43.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net] net: mlxsw: linecards: fix missing error check in mlxsw_linecard_devlink_info_get()
  2025-11-13 16:19 [PATCH net] net: mlxsw: linecards: fix missing error check in mlxsw_linecard_devlink_info_get() Pavel Zhigulin
@ 2025-11-13 19:15 ` Ido Schimmel
  2025-11-15  2:10 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Ido Schimmel @ 2025-11-13 19:15 UTC (permalink / raw)
  To: Pavel Zhigulin
  Cc: Petr Machata, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Jiri Pirko, netdev, linux-kernel,
	lvc-project

On Thu, Nov 13, 2025 at 07:19:21PM +0300, Pavel Zhigulin wrote:
> The call to devlink_info_version_fixed_put() in
> mlxsw_linecard_devlink_info_get() did not check for errors,
> although it is checked everywhere in the code.
> 
> Add missed 'err' check to the mlxsw_linecard_devlink_info_get()
> 
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
> 
> Fixes: 3fc0c51905fb ("mlxsw: core_linecards: Expose device PSID over device info")
> Signed-off-by: Pavel Zhigulin <Pavel.Zhigulin@kaspersky.com>

Reviewed-by: Ido Schimmel <idosch@nvidia.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net] net: mlxsw: linecards: fix missing error check in mlxsw_linecard_devlink_info_get()
  2025-11-13 16:19 [PATCH net] net: mlxsw: linecards: fix missing error check in mlxsw_linecard_devlink_info_get() Pavel Zhigulin
  2025-11-13 19:15 ` Ido Schimmel
@ 2025-11-15  2:10 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-11-15  2:10 UTC (permalink / raw)
  To: Pavel Zhigulin
  Cc: idosch, petrm, andrew+netdev, davem, edumazet, kuba, pabeni, jiri,
	netdev, linux-kernel, lvc-project

Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Thu, 13 Nov 2025 19:19:21 +0300 you wrote:
> The call to devlink_info_version_fixed_put() in
> mlxsw_linecard_devlink_info_get() did not check for errors,
> although it is checked everywhere in the code.
> 
> Add missed 'err' check to the mlxsw_linecard_devlink_info_get()
> 
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
> 
> [...]

Here is the summary with links:
  - [net] net: mlxsw: linecards: fix missing error check in mlxsw_linecard_devlink_info_get()
    https://git.kernel.org/netdev/net/c/b0c959fec18f

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-11-15  2:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-13 16:19 [PATCH net] net: mlxsw: linecards: fix missing error check in mlxsw_linecard_devlink_info_get() Pavel Zhigulin
2025-11-13 19:15 ` Ido Schimmel
2025-11-15  2:10 ` patchwork-bot+netdevbpf

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).