From: Colin Ian King Date: Fri, 14 Sep 2018 17:19:16 +0000 (+0100) Subject: net: caif: remove redundant null check on frontpkt X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=5d288b88655d5bea0cf3a42158cb3bf7916587bc;p=linux.git 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 --- 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;