bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] dpaa2-eth: fix error return code in setup_dpni()
@ 2020-04-27 10:43 Wei Yongjun
  2020-05-01  3:40 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Wei Yongjun @ 2020-04-27 10:43 UTC (permalink / raw)
  To: Ioana Ciornei, Ioana Radulescu, Russell King, Alexei Starovoitov,
	Daniel Borkmann, Jakub Kicinski
  Cc: Wei Yongjun, netdev, bpf, linux-media, dri-devel, linaro-mm-sig,
	kernel-janitors

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>
---
 drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

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;




^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next] dpaa2-eth: fix error return code in setup_dpni()
  2020-04-27 10:43 [PATCH net-next] dpaa2-eth: fix error return code in setup_dpni() Wei Yongjun
@ 2020-05-01  3:40 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2020-05-01  3:40 UTC (permalink / raw)
  To: weiyongjun1
  Cc: ioana.ciornei, ruxandra.radulescu, linux, ast, daniel, kuba,
	netdev, bpf, linux-media, dri-devel, linaro-mm-sig,
	kernel-janitors

From: Wei Yongjun <weiyongjun1@huawei.com>
Date: Mon, 27 Apr 2020 10:43:22 +0000

> 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>

Applied, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-05-01  3:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-27 10:43 [PATCH net-next] dpaa2-eth: fix error return code in setup_dpni() Wei Yongjun
2020-05-01  3:40 ` David Miller

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).