From patchwork Thu Oct 19 08:33:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Su Hui X-Patchwork-Id: 13428451 X-Patchwork-Delegate: kuba@kernel.org Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 209A8156C1 for ; Thu, 19 Oct 2023 08:34:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=none Received: from mail.nfschina.com (unknown [42.101.60.195]) by lindbergh.monkeyblade.net (Postfix) with SMTP id 12F3BAB; Thu, 19 Oct 2023 01:34:27 -0700 (PDT) Received: from localhost.localdomain (unknown [180.167.10.98]) by mail.nfschina.com (Maildata Gateway V2.8.8) with ESMTPA id C9F696071E216; Thu, 19 Oct 2023 16:34:10 +0800 (CST) X-MD-Sfrom: suhui@nfschina.com X-MD-SrcIP: 180.167.10.98 From: Su Hui To: shannon.nelson@amd.com, brett.creeley@amd.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: Su Hui , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH] pds_core: add an error code check in pdsc_dl_info_get Date: Thu, 19 Oct 2023 16:33:52 +0800 Message-Id: <20231019083351.1526484-1-suhui@nfschina.com> X-Mailer: git-send-email 2.30.2 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org check the value of 'ret' after call 'devlink_info_version_stored_put'. Signed-off-by: Su Hui Reviewed-by: Shannon Nelson --- 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,