From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Ioana Radulescu <ruxandra.radulescu@nxp.com>,
"David S . Miller" <davem@davemloft.net>,
Sasha Levin <sashal@kernel.org>,
netdev@vger.kernel.org
Subject: [PATCH AUTOSEL 5.1 31/70] dpaa2-eth: Use PTR_ERR_OR_ZERO where appropriate
Date: Sat, 8 Jun 2019 07:39:10 -0400 [thread overview]
Message-ID: <20190608113950.8033-31-sashal@kernel.org> (raw)
In-Reply-To: <20190608113950.8033-1-sashal@kernel.org>
From: Ioana Radulescu <ruxandra.radulescu@nxp.com>
[ Upstream commit bd8460fa4de46e9d6177af4fe33bf0763a7af4b7 ]
Use PTR_ERR_OR_ZERO instead of PTR_ERR in cases where
zero is a valid input. Reported by smatch.
Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
index 57cbaa38d247..df371c81a706 100644
--- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
+++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
@@ -1966,7 +1966,7 @@ alloc_channel(struct dpaa2_eth_priv *priv)
channel->dpcon = setup_dpcon(priv);
if (IS_ERR_OR_NULL(channel->dpcon)) {
- err = PTR_ERR(channel->dpcon);
+ err = PTR_ERR_OR_ZERO(channel->dpcon);
goto err_setup;
}
@@ -2022,7 +2022,7 @@ static int setup_dpio(struct dpaa2_eth_priv *priv)
/* Try to allocate a channel */
channel = alloc_channel(priv);
if (IS_ERR_OR_NULL(channel)) {
- err = PTR_ERR(channel);
+ err = PTR_ERR_OR_ZERO(channel);
if (err != -EPROBE_DEFER)
dev_info(dev,
"No affine channel for cpu %d and above\n", i);
--
2.20.1
next prev parent reply other threads:[~2019-06-08 11:53 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20190608113950.8033-1-sashal@kernel.org>
2019-06-08 11:38 ` [PATCH AUTOSEL 5.1 09/70] netfilter: nf_tables: fix oops during rule dump Sasha Levin
2019-06-08 11:38 ` [PATCH AUTOSEL 5.1 11/70] netfilter: nf_queue: fix reinject verdict handling Sasha Levin
2019-06-08 11:38 ` [PATCH AUTOSEL 5.1 12/70] netfilter: nft_fib: Fix existence check support Sasha Levin
2019-06-08 11:38 ` [PATCH AUTOSEL 5.1 13/70] ipvs: Fix use-after-free in ip_vs_in Sasha Levin
2019-06-08 11:38 ` [PATCH AUTOSEL 5.1 15/70] netfilter: nat: fix udp checksum corruption Sasha Levin
2019-06-08 11:38 ` [PATCH AUTOSEL 5.1 19/70] mISDN: make sure device name is NUL terminated Sasha Levin
2019-06-08 11:39 ` [PATCH AUTOSEL 5.1 26/70] net: stmmac: update rx tail pointer register to fix rx dma hang issue Sasha Levin
2019-06-08 11:39 ` [PATCH AUTOSEL 5.1 27/70] net: stmmac: fix csr_clk can't be zero issue Sasha Levin
2019-06-08 11:39 ` [PATCH AUTOSEL 5.1 28/70] net: stmmac: dwmac-mediatek: modify csr_clk value to fix mdio read/write fail Sasha Levin
2019-06-08 11:39 ` [PATCH AUTOSEL 5.1 30/70] dpaa2-eth: Fix potential spectre issue Sasha Levin
2019-06-08 11:39 ` Sasha Levin [this message]
2019-06-08 11:39 ` [PATCH AUTOSEL 5.1 32/70] net: tulip: de4x5: Drop redundant MODULE_DEVICE_TABLE() Sasha Levin
2019-06-08 11:39 ` [PATCH AUTOSEL 5.1 37/70] net: aquantia: tx clean budget logic error Sasha Levin
2019-06-08 11:39 ` [PATCH AUTOSEL 5.1 38/70] net: aquantia: fix LRO with FCS error Sasha Levin
2019-06-08 11:39 ` [PATCH AUTOSEL 5.1 48/70] dpaa_eth: use only online CPU portals Sasha Levin
2019-06-08 11:39 ` [PATCH AUTOSEL 5.1 59/70] net: sh_eth: fix mdio access in sh_eth_close() for R-Car Gen2 and RZ/A1 SoCs Sasha Levin
2019-06-08 11:39 ` [PATCH AUTOSEL 5.1 61/70] net: phylink: ensure consistent phy interface mode Sasha Levin
2019-06-08 11:39 ` [PATCH AUTOSEL 5.1 62/70] net: phy: dp83867: fix speed 10 in sgmii mode Sasha Levin
2019-06-08 11:39 ` [PATCH AUTOSEL 5.1 63/70] net: phy: dp83867: increase SGMII autoneg timer duration Sasha Levin
2019-06-08 11:39 ` [PATCH AUTOSEL 5.1 64/70] net: phy: dp83867: Set up RGMII TX delay Sasha Levin
2019-06-08 11:39 ` [PATCH AUTOSEL 5.1 69/70] mlxsw: spectrum: Prevent force of 56G 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=20190608113950.8033-31-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=ruxandra.radulescu@nxp.com \
--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).