Skip to contentSkip to conversation

net: caif: remove redundant null check on frontpkt

PATCH New Colin King 1 participant 1 message Sep 18, 2018

Subsystems (3)
lore
Share & tools
lore

Colin King

author
#0 lore raw

PATCH 1/1 net: caif: remove redundant null check on frontpkt

From: Colin Ian King <[email protected]>

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 realpkt 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")

---
 net/caif/cfrfml.c | 3 ---
 1 file changed, 3 deletions(-)
net/caif/cfrfml.c +0 -3
index b82440e1fcb4..a931a71ef6df 100644
@@ -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;
Signature · 1 line
2.17.1