linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Jason Gunthorpe <jgg@mellanox.com>,
	"David S . Miller" <davem@davemloft.net>,
	Sasha Levin <sashal@kernel.org>,
	netdev@vger.kernel.org
Subject: [PATCH AUTOSEL 5.4 19/26] net/cxgb4: Check the return from t4_query_params properly
Date: Fri, 24 Apr 2020 08:23:16 -0400	[thread overview]
Message-ID: <20200424122323.10194-19-sashal@kernel.org> (raw)
In-Reply-To: <20200424122323.10194-1-sashal@kernel.org>

From: Jason Gunthorpe <jgg@mellanox.com>

[ Upstream commit c799fca8baf18d1bbbbad6c3b736eefbde8bdb90 ]

Positive return values are also failures that don't set val,
although this probably can't happen. Fixes gcc 10 warning:

drivers/net/ethernet/chelsio/cxgb4/t4_hw.c: In function ‘t4_phy_fw_ver’:
drivers/net/ethernet/chelsio/cxgb4/t4_hw.c:3747:14: warning: ‘val’ may be used uninitialized in this function [-Wmaybe-uninitialized]
 3747 |  *phy_fw_ver = val;

Fixes: 01b6961410b7 ("cxgb4: Add PHY firmware support for T420-BT cards")
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/ethernet/chelsio/cxgb4/t4_hw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
index 3f6813daf3c10..31fcfc58e3373 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
@@ -3748,7 +3748,7 @@ int t4_phy_fw_ver(struct adapter *adap, int *phy_fw_ver)
 		 FW_PARAMS_PARAM_Z_V(FW_PARAMS_PARAM_DEV_PHYFW_VERSION));
 	ret = t4_query_params(adap, adap->mbox, adap->pf, 0, 1,
 			      &param, &val);
-	if (ret < 0)
+	if (ret)
 		return ret;
 	*phy_fw_ver = val;
 	return 0;
-- 
2.20.1


  parent reply	other threads:[~2020-04-24 12:29 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-24 12:22 [PATCH AUTOSEL 5.4 01/26] libbpf: Initialize *nl_pid so gcc 10 is happy Sasha Levin
2020-04-24 12:22 ` [PATCH AUTOSEL 5.4 02/26] net: fec: set GPR bit on suspend by DT configuration Sasha Levin
2020-04-24 12:23 ` [PATCH AUTOSEL 5.4 03/26] x86: hyperv: report value of misc_features Sasha Levin
2020-04-24 12:23 ` [PATCH AUTOSEL 5.4 04/26] signal: check sig before setting info in kill_pid_usb_asyncio Sasha Levin
2020-04-24 12:23 ` [PATCH AUTOSEL 5.4 05/26] afs: Fix length of dump of bad YFSFetchStatus record Sasha Levin
2020-04-24 12:23 ` [PATCH AUTOSEL 5.4 06/26] xfs: acquire superblock freeze protection on eofblocks scans Sasha Levin
2020-04-24 12:23 ` [PATCH AUTOSEL 5.4 07/26] xfs: fix partially uninitialized structure in xfs_reflink_remap_extent Sasha Levin
2020-04-24 12:23 ` [PATCH AUTOSEL 5.4 08/26] ALSA: hda: Release resources at error in delayed probe Sasha Levin
2020-04-24 12:23 ` [PATCH AUTOSEL 5.4 09/26] ALSA: hda: Keep the controller initialization even if no codecs found Sasha Levin
2020-04-24 12:23 ` [PATCH AUTOSEL 5.4 10/26] ALSA: hda: Skip controller resume if not needed Sasha Levin
2020-04-24 12:23 ` [PATCH AUTOSEL 5.4 11/26] ALSA: hda: Explicitly permit using autosuspend if runtime PM is supported Sasha Levin
2020-04-24 12:23 ` [PATCH AUTOSEL 5.4 12/26] scsi: target: fix PR IN / READ FULL STATUS for FC Sasha Levin
2020-04-24 12:23 ` [PATCH AUTOSEL 5.4 13/26] scsi: target: tcmu: reset_ring should reset TCMU_DEV_BIT_BROKEN Sasha Levin
2020-04-24 12:23 ` [PATCH AUTOSEL 5.4 14/26] objtool: Fix CONFIG_UBSAN_TRAP unreachable warnings Sasha Levin
2020-04-24 12:23 ` [PATCH AUTOSEL 5.4 15/26] objtool: Support Clang non-section symbols in ORC dump Sasha Levin
2020-04-24 12:23 ` [PATCH AUTOSEL 5.4 16/26] xen/xenbus: ensure xenbus_map_ring_valloc() returns proper grant status Sasha Levin
2020-04-24 12:23 ` [PATCH AUTOSEL 5.4 17/26] ALSA: hda: call runtime_allow() for all hda controllers Sasha Levin
2020-04-24 12:23 ` [PATCH AUTOSEL 5.4 18/26] net: stmmac: socfpga: Allow all RGMII modes Sasha Levin
2020-04-24 12:23 ` Sasha Levin [this message]
2020-04-24 12:23 ` [PATCH AUTOSEL 5.4 20/26] mac80211: fix channel switch trigger from unknown mesh peer Sasha Levin
2020-04-24 12:23 ` [PATCH AUTOSEL 5.4 21/26] arm64: Delete the space separator in __emit_inst Sasha Levin
2020-04-24 12:23 ` [PATCH AUTOSEL 5.4 22/26] ext4: use matching invalidatepage in ext4_writepage Sasha Levin
2020-04-24 12:23 ` [PATCH AUTOSEL 5.4 23/26] ext4: increase wait time needed before reuse of deleted inode numbers Sasha Levin
2020-04-24 12:23 ` [PATCH AUTOSEL 5.4 24/26] ext4: convert BUG_ON's to WARN_ON's in mballoc.c Sasha Levin
2020-04-24 12:23 ` [PATCH AUTOSEL 5.4 25/26] blk-mq: Put driver tag in blk_mq_dispatch_rq_list() when no budget Sasha Levin
2020-04-24 12:23 ` [PATCH AUTOSEL 5.4 26/26] hwmon: (jc42) Fix name to have no illegal characters Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200424122323.10194-19-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=davem@davemloft.net \
    --cc=jgg@mellanox.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).