diff options
author | Jiapeng Chong <jiapeng.chong@linux.alibaba.com> | 2021-05-17 13:15:25 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-05-18 02:03:56 +0300 |
commit | 25c55b38d85b54e49f2c9a3c7d483d1a24173b94 (patch) | |
tree | 88f92689cf48f44eb85ca8ea7e8b142999bb1039 /net/packet/af_packet.c | |
parent | 8ed2e60b7788825d71e70ed26160d327a588dee5 (diff) | |
download | linux-25c55b38d85b54e49f2c9a3c7d483d1a24173b94.tar.xz |
net/packet: Remove redundant assignment to ret
Variable ret is set to '0' or '-EBUSY', but this value is never read
as it is not used later on, hence it is a redundant assignment and
can be removed.
Clean up the following clang-analyzer warning:
net/packet/af_packet.c:3936:4: warning: Value stored to 'ret' is never
read [clang-analyzer-deadcode.DeadStores].
net/packet/af_packet.c:3933:4: warning: Value stored to 'ret' is never
read [clang-analyzer-deadcode.DeadStores].
No functional change.
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/packet/af_packet.c')
-rw-r--r-- | net/packet/af_packet.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index ba96db1880ea..597d798ac0a5 100644 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c @@ -3923,12 +3923,9 @@ packet_setsockopt(struct socket *sock, int level, int optname, sockptr_t optval, return -EFAULT; lock_sock(sk); - if (po->rx_ring.pg_vec || po->tx_ring.pg_vec) { - ret = -EBUSY; - } else { + if (!po->rx_ring.pg_vec && !po->tx_ring.pg_vec) po->tp_tx_has_off = !!val; - ret = 0; - } + release_sock(sk); return 0; } |