net: caif: remove redundant null check on frontpkt
authorColin Ian King <colin.king@canonical.com>
Fri, 14 Sep 2018 17:19:16 +0000 (18:19 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 18 Sep 2018 01:49:57 +0000 (18:49 -0700)
It is impossible for frontpkt to be null at the point of the null
check because it has been assigned from rearpkt and there is no
way rearpkt can be null at the point of the assignment because
of the sanity checking and exit paths taken previously. Remove
the redundant null check.

Detected by CoverityScan, CID#114434 ("Logically dead code")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/caif/cfrfml.c

index b82440e1fcb4f3fe8a25e121416360cc23f8fada..a931a71ef6df4860684fc459fe6228feab7c3cb8 100644 (file)
@@ -264,9 +264,6 @@ static int cfrfml_transmit(struct cflayer *layr, struct cfpkt *pkt)
                frontpkt = rearpkt;
                rearpkt = NULL;
 
-               err = -ENOMEM;
-               if (frontpkt == NULL)
-                       goto out;
                err = -EPROTO;
                if (cfpkt_add_head(frontpkt, head, 6) < 0)
                        goto out;