[ovs-dev,net-next] openvswitch: remove BUG_ON from get_dpdev

Message ID 1541680820-20158-1-git-send-email-lirongqing@baidu.com
State New
Headers show
Series
  • [ovs-dev,net-next] openvswitch: remove BUG_ON from get_dpdev
Related show

Commit Message

Li RongQing Nov. 8, 2018, 12:40 p.m.
if local is NULL pointer, and the following access of local's
dev will trigger panic, which is same as BUG_ON

Signed-off-by: Li RongQing <lirongqing@baidu.com>
---
 net/openvswitch/vport-netdev.c | 1 -
 1 file changed, 1 deletion(-)

Comments

David Miller Nov. 9, 2018, 1:15 a.m. | #1
From: Li RongQing <lirongqing@baidu.com>
Date: Thu,  8 Nov 2018 20:40:20 +0800

> if local is NULL pointer, and the following access of local's
> dev will trigger panic, which is same as BUG_ON
> 
> Signed-off-by: Li RongQing <lirongqing@baidu.com>

Applied.

Patch

diff --git a/net/openvswitch/vport-netdev.c b/net/openvswitch/vport-netdev.c
index 2e5e7a41d8ef..9bec22e3e9e8 100644
--- a/net/openvswitch/vport-netdev.c
+++ b/net/openvswitch/vport-netdev.c
@@ -84,7 +84,6 @@  static struct net_device *get_dpdev(const struct datapath *dp)
 	struct vport *local;
 
 	local = ovs_vport_ovsl(dp, OVSP_LOCAL);
-	BUG_ON(!local);
 	return local->dev;
 }