[PATCH] pds_core: add an error code check in pdsc_dl_info_get

From: Su Hui
Date: Thu Oct 19 2023 - 04:34:32 EST


check the value of 'ret' after call 'devlink_info_version_stored_put'.

Signed-off-by: Su Hui <suhui@xxxxxxxxxxxx>
---
drivers/net/ethernet/amd/pds_core/devlink.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/net/ethernet/amd/pds_core/devlink.c b/drivers/net/ethernet/amd/pds_core/devlink.c
index d9607033bbf2..09041f7fccaf 100644
--- a/drivers/net/ethernet/amd/pds_core/devlink.c
+++ b/drivers/net/ethernet/amd/pds_core/devlink.c
@@ -124,6 +124,8 @@ int pdsc_dl_info_get(struct devlink *dl, struct devlink_info_req *req,
snprintf(buf, sizeof(buf), "fw.slot_%d", i);
err = devlink_info_version_stored_put(req, buf,
fw_list.fw_names[i].fw_version);
+ if (err)
+ return err;
}

err = devlink_info_version_running_put(req,
--
2.30.2