From 6f712c9cfe394bf0a7d8298698c9dd72a7eb2122 Mon Sep 17 00:00:00 2001 From: Colin Ian King Date: Fri, 14 Sep 2018 18:19:16 +0100 Subject: [PATCH] net: caif: remove redundant null check on frontpkt 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 Signed-off-by: David S. Miller --- net/caif/cfrfml.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/net/caif/cfrfml.c b/net/caif/cfrfml.c index b82440e1fcb4f..a931a71ef6df4 100644 --- a/net/caif/cfrfml.c +++ b/net/caif/cfrfml.c @@ -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; -- 2.39.5