summaryrefslogtreecommitdiff
path: root/datapath
diff options
context:
space:
mode:
authorEelco Chaudron <echaudro@redhat.com>2020-10-12 13:24:48 -0700
committerIlya Maximets <i.maximets@ovn.org>2020-10-17 17:32:06 +0200
commit5821a592a4d73ea3466d5b2b051181c6e71d3c8a (patch)
tree62f33d9bf65a4241f2e080bb8ee7cc09d1fac1b3 /datapath
parent8205fbc8f5e0ae5c85b9d1be2f5f53997ea4ff31 (diff)
downloadopenvswitch-5821a592a4d73ea3466d5b2b051181c6e71d3c8a.tar.gz
datapath: return an error instead of doing BUG_ON()
Upstream commit: commit a734d1f4c2fc962ef4daa179e216df84a8ec5f84 Author: Eelco Chaudron <echaudro@redhat.com> Date: Thu May 2 16:12:38 2019 -0400 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> Acked-by: Eelco Chaudron <echaudro@redhat.com> Acked-by: Yi-Hung Wei <yihung.wei@gmail.com> Signed-off-by: Greg Rose <gvrose8192@gmail.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Diffstat (limited to 'datapath')
-rw-r--r--datapath/datapath.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/datapath/datapath.c b/datapath/datapath.c
index 05c1e4274..d604bfd36 100644
--- a/datapath/datapath.c
+++ b/datapath/datapath.c
@@ -469,7 +469,8 @@ static int queue_userspace_packet(struct datapath *dp, struct sk_buff *skb,
upcall->dp_ifindex = dp_ifindex;
err = ovs_nla_put_key(key, key, OVS_PACKET_ATTR_KEY, false, user_skb);
- BUG_ON(err);
+ if (err)
+ goto out;
if (upcall_info->userdata)
__nla_put(user_skb, OVS_PACKET_ATTR_USERDATA,
@@ -486,7 +487,9 @@ static int queue_userspace_packet(struct datapath *dp, struct sk_buff *skb,
}
err = ovs_nla_put_tunnel_info(user_skb,
upcall_info->egress_tun_info);
- BUG_ON(err);
+ if (err)
+ goto out;
+
nla_nest_end(user_skb, nla);
}