Skip to content

Commit 02afa9c

Browse files
YueHaibingdavem330
authored andcommitted
dpaa2-eth: Fix passing zero to 'PTR_ERR' warning
Fix smatch warning: drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c:2419 alloc_channel() warn: passing zero to 'ERR_PTR' setup_dpcon() should return ERR_PTR(err) instead of zero in error handling case. Fixes: d7f5a9d ("dpaa2-eth: defer probe on object allocate") Signed-off-by: YueHaibing <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent f7ba7db commit 02afa9c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2370,7 +2370,7 @@ static struct fsl_mc_device *setup_dpcon(struct dpaa2_eth_priv *priv)
23702370
free:
23712371
fsl_mc_object_free(dpcon);
23722372

2373-
return NULL;
2373+
return ERR_PTR(err);
23742374
}
23752375

23762376
static void free_dpcon(struct dpaa2_eth_priv *priv,
@@ -2394,8 +2394,8 @@ alloc_channel(struct dpaa2_eth_priv *priv)
23942394
return NULL;
23952395

23962396
channel->dpcon = setup_dpcon(priv);
2397-
if (IS_ERR_OR_NULL(channel->dpcon)) {
2398-
err = PTR_ERR_OR_ZERO(channel->dpcon);
2397+
if (IS_ERR(channel->dpcon)) {
2398+
err = PTR_ERR(channel->dpcon);
23992399
goto err_setup;
24002400
}
24012401

0 commit comments

Comments
 (0)