Skip to content

Commit 8a574f8

Browse files
Paolo Abenidavem330
authored andcommitted
openvswitch: remove another BUG_ON()
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>
1 parent 8ffeb03 commit 8a574f8

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
@@ -1372,14 +1372,18 @@ static int ovs_flow_cmd_del(struct sk_buff *skb, struct genl_info *info)
13721372
OVS_FLOW_CMD_DEL,
13731373
ufid_flags);
13741374
rcu_read_unlock();
1375-
BUG_ON(err < 0);
1375+
if (WARN_ON_ONCE(err < 0)) {
1376+
kfree_skb(reply);
1377+
goto out_free;
1378+
}
13761379

13771380
ovs_notify(&dp_flow_genl_family, reply, info);
13781381
} else {
13791382
netlink_set_err(sock_net(skb->sk)->genl_sock, 0, 0, PTR_ERR(reply));
13801383
}
13811384
}
13821385

1386+
out_free:
13831387
ovs_flow_free(flow, true);
13841388
return 0;
13851389
unlock:

0 commit comments

Comments
 (0)