Blob Blame History Raw
From: David Ahern <dsahern@gmail.com>
Date: Fri, 21 Feb 2020 12:53:09 -0700
Subject: tun: Remove unnecessary BUG_ON check in tun_net_xmit
Patch-mainline: v5.7-rc1
Git-commit: fb0b1c60421f2fb8de2f2dfa628c7c1c3f034bcc
References: bsc#1176447

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

Cc: Jason Wang <jasowang@redhat.com>
Signed-off-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Acked-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>
---
 drivers/net/tun.c |    2 --
 1 file changed, 2 deletions(-)

--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -1078,8 +1078,6 @@ static netdev_tx_t tun_net_xmit(struct s
 
 	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. */