Skip to content

Commit

Permalink
net: openvswitch: return an error instead of doing BUG_ON()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Eelco Chaudron authored and David S. Miller committed May 4, 2019
1 parent 3aa4c49 commit a734d1f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions net/openvswitch/datapath.c
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,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,
Expand All @@ -471,7 +472,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);
}

Expand Down

0 comments on commit a734d1f

Please sign in to comment.