mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] cxgb4: Fix missing error code in cxgb4_port_mirror_alloc()
@ 2023-10-27  4:00 Jiapeng Chong
  0 siblings, 0 replies; only message in thread
From: Jiapeng Chong @ 2023-10-27  4:00 UTC (permalink / raw)
  To: rajur
  Cc: davem, edumazet, kuba, pabeni, netdev, linux-kernel,
	Jiapeng Chong, Abaci Robot

The error code is missing in this code scenario, add the error code
'-EINVAL' to the return value 'ret'.

drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c:1525 cxgb4_port_mirror_alloc() warn: missing error code 'ret'.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=7063
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
 drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
index 2eb33a727bba..e59e199184f4 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
@@ -1522,6 +1522,7 @@ int cxgb4_port_mirror_alloc(struct net_device *dev)
 	mutex_lock(&pi->vi_mirror_mutex);
 	if (pi->viid_mirror) {
 		pi->vi_mirror_count++;
+		ret = -EINVAL;
 		goto out_unlock;
 	}
 
-- 
2.20.1.7.g153144c


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-10-27  4:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-27  4:00 [PATCH] cxgb4: Fix missing error code in cxgb4_port_mirror_alloc() Jiapeng Chong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®