Skip to content

Commit cf8d9ad

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 f6abebb commit cf8d9ad

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
@@ -1350,14 +1350,18 @@ static int ovs_flow_cmd_del(struct sk_buff *skb, struct genl_info *info)
13501350
OVS_FLOW_CMD_DEL,
13511351
ufid_flags);
13521352
rcu_read_unlock();
1353-
BUG_ON(err < 0);
1353+
if (WARN_ON_ONCE(err < 0)) {
1354+
kfree_skb(reply);
1355+
goto out_free;
1356+
}
13541357

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

1364+
out_free:
13611365
ovs_flow_free(flow, true);
13621366
return 0;
13631367
unlock:

0 commit comments

Comments
 (0)