diff options
author | Yang Li <yang.lee@linux.alibaba.com> | 2021-11-05 08:12:50 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-11-05 11:45:03 +0100 |
commit | 3f81c579912855f19ed1a72af8133485a6119fba (patch) | |
tree | 7da1fc8ce43d19dee912ef6c2e5889fdc8931ead /drivers | |
parent | net: ax88796c: hide ax88796c_dt_ids if !CONFIG_OF (diff) | |
download | linux-3f81c579912855f19ed1a72af8133485a6119fba.tar.xz linux-3f81c579912855f19ed1a72af8133485a6119fba.zip |
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/amt.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/amt.c b/drivers/net/amt.c index 896c9e2857f0..cfd6c8cb4e97 100644 --- a/drivers/net/amt.c +++ b/drivers/net/amt.c @@ -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: |