]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
net: mlxsw: linecards: fix missing error check in mlxsw_linecard_devlink_info_get()
authorPavel Zhigulin <Pavel.Zhigulin@kaspersky.com>
Thu, 13 Nov 2025 16:19:21 +0000 (19:19 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 6 Dec 2025 21:12:38 +0000 (06:12 +0900)
[ Upstream commit b0c959fec18f4595a6a6317ffc30615cfa37bf69 ]

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

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>
Link: https://patch.msgid.link/20251113161922.813828-1-Pavel.Zhigulin@kaspersky.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/mellanox/mlxsw/core_linecards.c

index 99196333d1324a020c73a4ba718b219afde16aed..525973da7abc95b1346c792349ad2c6f41ca228c 100644 (file)
@@ -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);