public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net/atm/mpc: Fix dereference NULL pointer in mpc_send_packet()
@ 2023-02-23  6:54 Li Qiong
  2023-02-23  7:59 ` Dan Carpenter
  0 siblings, 1 reply; 2+ messages in thread
From: Li Qiong @ 2023-02-23  6:54 UTC (permalink / raw)
  To: David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni
  Cc: netdev, linux-kernel, kernel-janitors, Yu Zhe, Li Qiong

The 'non_ip' statement need do 'mpc' pointer dereference,
so return '-ENODEV' if 'mpc' is NULL.

Signed-off-by: Li Qiong <liqiong@nfschina.com>
---
 net/atm/mpc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/atm/mpc.c b/net/atm/mpc.c
index 033871e718a3..1cd6610b8a12 100644
--- a/net/atm/mpc.c
+++ b/net/atm/mpc.c
@@ -577,7 +577,7 @@ static netdev_tx_t mpc_send_packet(struct sk_buff *skb,
 	mpc = find_mpc_by_lec(dev); /* this should NEVER fail */
 	if (mpc == NULL) {
 		pr_info("(%s) no MPC found\n", dev->name);
-		goto non_ip;
+		return -ENODEV;
 	}
 
 	eth = (struct ethhdr *)skb->data;
-- 
2.11.0


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

end of thread, other threads:[~2023-02-23  7:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-23  6:54 [PATCH] net/atm/mpc: Fix dereference NULL pointer in mpc_send_packet() Li Qiong
2023-02-23  7:59 ` Dan Carpenter

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