Skip to contentSkip to conversation

tun: Remove unnecessary BUG_ON check in tun_net_xmit

PATCH Applied David Ahern 3 participants 3 messages Feb 21, 2020 – Feb 24, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tun: Remove unnecessary BUG_ON check in tun_net_xmit

From: David Ahern <[email protected]>

The BUG_ON for NULL tfile is now redundant due to a recently added null check after the rcu_dereference. Remove the BUG_ON.

---
 drivers/net/tun.c | 2 --
 1 file changed, 2 deletions(-)
drivers/net/tun.c +0 -2
index 650c937ed56b..79f248cb282d 100644
@@ -1078,8 +1078,6 @@ static netdev_tx_t tun_net_xmit(struct sk_buff *skb, struct net_device *dev)
 
 	tun_debug(KERN_INFO, tun, "tun_net_xmit %d\n", skb->len);
 
-	BUG_ON(!tfile);
-
 	/* Drop if the filter does not like it.
 	 * This is a noop if the filter is disabled.
 	 * Filter can be enabled only for the TAP devices. */
Signature · 1 line
2.17.1