net/packet: remove redundant initialization of variable err
authorColin Ian King <colin.king@canonical.com>
Wed, 1 Jul 2020 15:04:33 +0000 (16:04 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 1 Jul 2020 19:44:52 +0000 (12:44 -0700)
The variable err is being initialized with a value that is never read
and it is being updated later with a new value.  The initialization is
redundant and can be removed.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/packet/af_packet.c

index 29bd405..7b436eb 100644 (file)
@@ -4293,7 +4293,7 @@ static int packet_set_ring(struct sock *sk, union tpacket_req_u *req_u,
        struct packet_ring_buffer *rb;
        struct sk_buff_head *rb_queue;
        __be16 num;
-       int err = -EINVAL;
+       int err;
        /* Added to avoid minimal code churn */
        struct tpacket_req *req = &req_u->req;