[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230223065446.24173-1-liqiong@nfschina.com>
Date: Thu, 23 Feb 2023 14:54:46 +0800
From: Li Qiong <liqiong@...china.com>
To: "David S . Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>
Cc: netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
kernel-janitors@...r.kernel.org, Yu Zhe <yuzhe@...china.com>,
Li Qiong <liqiong@...china.com>
Subject: [PATCH] net/atm/mpc: Fix dereference NULL pointer in mpc_send_packet()
The 'non_ip' statement need do 'mpc' pointer dereference,
so return '-ENODEV' if 'mpc' is NULL.
Signed-off-by: Li Qiong <liqiong@...china.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
Powered by blists - more mailing lists