aboutsummaryrefslogtreecommitdiffstats
path: root/net/openvswitch
diff options
context:
space:
mode:
authorEelco Chaudron <echaudro@redhat.com>2019-05-02 16:12:38 -0400
committerDavid S. Miller <davem@davemloft.net>2019-05-04 01:36:36 -0400
commita734d1f4c2fc962ef4daa179e216df84a8ec5f84 (patch)
treec491684ed2d58f4ca580e02da067d756f18e107c /net/openvswitch
parent3aa4c491c55dadd9d5c19f0a8443cb4a2ab41651 (diff)
net: openvswitch: return an error instead of doing BUG_ON()
For all other error cases in queue_userspace_packet() the error is returned, so it makes sense to do the same for these two error cases. Reported-by: Davide Caratti <dcaratti@redhat.com> Signed-off-by: Eelco Chaudron <echaudro@redhat.com> Acked-by: Flavio Leitner <fbl@sysclose.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/openvswitch')
-rw-r--r--net/openvswitch/datapath.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c
index b95015c7e999..dc9ff9367221 100644
--- a/net/openvswitch/datapath.c
+++ b/net/openvswitch/datapath.c
@@ -455,7 +455,8 @@ static int queue_userspace_packet(struct datapath *dp, struct sk_buff *skb,
455 upcall->dp_ifindex = dp_ifindex; 455 upcall->dp_ifindex = dp_ifindex;
456 456
457 err = ovs_nla_put_key(key, key, OVS_PACKET_ATTR_KEY, false, user_skb); 457 err = ovs_nla_put_key(key, key, OVS_PACKET_ATTR_KEY, false, user_skb);
458 BUG_ON(err); 458 if (err)
459 goto out;
459 460
460 if (upcall_info->userdata) 461 if (upcall_info->userdata)
461 __nla_put(user_skb, OVS_PACKET_ATTR_USERDATA, 462 __nla_put(user_skb, OVS_PACKET_ATTR_USERDATA,
@@ -471,7 +472,9 @@ static int queue_userspace_packet(struct datapath *dp, struct sk_buff *skb,
471 } 472 }
472 err = ovs_nla_put_tunnel_info(user_skb, 473 err = ovs_nla_put_tunnel_info(user_skb,
473 upcall_info->egress_tun_info); 474 upcall_info->egress_tun_info);
474 BUG_ON(err); 475 if (err)
476 goto out;
477
475 nla_nest_end(user_skb, nla); 478 nla_nest_end(user_skb, nla);
476 } 479 }
477 480