summaryrefslogtreecommitdiffstats
path: root/net/packet
diff options
context:
space:
mode:
authorJiapeng Chong <jiapeng.chong@linux.alibaba.com>2021-05-17 18:15:25 +0800
committerDavid S. Miller <davem@davemloft.net>2021-05-17 16:03:56 -0700
commit25c55b38d85b54e49f2c9a3c7d483d1a24173b94 (patch)
tree88f92689cf48f44eb85ca8ea7e8b142999bb1039 /net/packet
parent8ed2e60b7788825d71e70ed26160d327a588dee5 (diff)
downloadlinux-25c55b38d85b54e49f2c9a3c7d483d1a24173b94.tar.bz2
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')
-rw-r--r--net/packet/af_packet.c7
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;
}