Commit 25c55b38 authored by Jiapeng Chong's avatar Jiapeng Chong Committed by David S. Miller
Browse files

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: default avatarAbaci Robot <abaci@linux.alibaba.com>
Signed-off-by: default avatarJiapeng Chong <jiapeng.chong@linux.alibaba.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8ed2e60b
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -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;
	}