فهرست منبع

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 <colin.king@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Colin Ian King 7 سال پیش
والد
کامیت
5d288b8865
1فایلهای تغییر یافته به همراه0 افزوده شده و 3 حذف شده
  1. 0 3
      net/caif/cfrfml.c

+ 0 - 3
net/caif/cfrfml.c

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