summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorWei Yongjun <weiyongjun1@huawei.com>2020-04-27 10:43:22 +0000
committerDavid S. Miller <davem@davemloft.net>2020-04-30 20:40:31 -0700
commit97fff7c8de1e54e5326dfeb66085796864bceb64 (patch)
treebad6320718b85579c30c8490180bcce1ec9fc22a /drivers
parentc4db9934a33e5f276965a14b3eea7a6d64c85065 (diff)
dpaa2-eth: fix error return code in setup_dpni()
Fix to return negative error code -ENOMEM from the error handling case instead of 0, as done elsewhere in this function. Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
index 8ec435ba7d27..11accab81ea1 100644
--- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
+++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
@@ -2702,8 +2702,10 @@ static int setup_dpni(struct fsl_mc_device *ls_dev)
priv->cls_rules = devm_kzalloc(dev, sizeof(struct dpaa2_eth_cls_rule) *
dpaa2_eth_fs_count(priv), GFP_KERNEL);
- if (!priv->cls_rules)
+ if (!priv->cls_rules) {
+ err = -ENOMEM;
goto close;
+ }
return 0;