diff options
author | Ioana Radulescu <ruxandra.radulescu@nxp.com> | 2019-05-24 17:15:16 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-05-26 22:41:33 +0200 |
commit | bd8460fa4de46e9d6177af4fe33bf0763a7af4b7 (patch) | |
tree | e7184bf62b4d75b266d6bfd40d2cb985b11c0f8d /drivers/net | |
parent | dpaa2-eth: Fix potential spectre issue (diff) | |
download | linux-bd8460fa4de46e9d6177af4fe33bf0763a7af4b7.tar.xz linux-bd8460fa4de46e9d6177af4fe33bf0763a7af4b7.zip |
dpaa2-eth: Use PTR_ERR_OR_ZERO where appropriate
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>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c | 4 |
1 files 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 63b1ecc18c26..7d2390e3df77 100644 --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c @@ -1972,7 +1972,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; } @@ -2028,7 +2028,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); |