mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
amt: Fix NULL but dereferenced coccicheck error
Eliminate the following coccicheck warning: ./drivers/net/amt.c:2795:6-9: ERROR: amt is NULL but dereferenced. Reported-by: Abaci Robot <abaci@linux.alibaba.com> Signed-off-by: Yang Li <yang.lee@linux.alibaba.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
6789a4c051
commit
3f81c57991
1 changed files with 2 additions and 1 deletions
|
@ -2766,7 +2766,7 @@ static int amt_err_lookup(struct sock *sk, struct sk_buff *skb)
|
|||
rcu_read_lock_bh();
|
||||
amt = rcu_dereference_sk_user_data(sk);
|
||||
if (!amt)
|
||||
goto drop;
|
||||
goto out;
|
||||
|
||||
if (amt->mode != AMT_MODE_GATEWAY)
|
||||
goto drop;
|
||||
|
@ -2788,6 +2788,7 @@ static int amt_err_lookup(struct sock *sk, struct sk_buff *skb)
|
|||
default:
|
||||
goto drop;
|
||||
}
|
||||
out:
|
||||
rcu_read_unlock_bh();
|
||||
return 0;
|
||||
drop:
|
||||
|
|
Loading…
Add table
Reference in a new issue