Skip to content

Commit ab46fb3

Browse files
Paolo Abenigregkh
authored andcommitted
openvswitch: remove another BUG_ON()
[ Upstream commit 8a574f8 ] If we can't build the flow del notification, we can simply delete the flow, no need to crash the kernel. Still keep a WARN_ON to preserve debuggability. Note: the BUG_ON() predates the Fixes tag, but this change can be applied only after the mentioned commit. v1 -> v2: - do not leak an skb on error Fixes: aed0677 ("openvswitch: Minimize ovs_flow_cmd_del critical section.") Signed-off-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 910d9e8 commit ab46fb3

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎net/openvswitch/datapath.c‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1353,14 +1353,18 @@ static int ovs_flow_cmd_del(struct sk_buff *skb, struct genl_info *info)
13531353
OVS_FLOW_CMD_DEL,
13541354
ufid_flags);
13551355
rcu_read_unlock();
1356-
BUG_ON(err < 0);
1356+
if (WARN_ON_ONCE(err < 0)) {
1357+
kfree_skb(reply);
1358+
goto out_free;
1359+
}
13571360

13581361
ovs_notify(&dp_flow_genl_family, reply, info);
13591362
} else {
13601363
netlink_set_err(sock_net(skb->sk)->genl_sock, 0, 0, PTR_ERR(reply));
13611364
}
13621365
}
13631366

1367+
out_free:
13641368
ovs_flow_free(flow, true);
13651369
return 0;
13661370
unlock:

0 commit comments

Comments
 (0)