Skip to content

Commit a734d1f

Browse files
chaudrondavem330
authored andcommitted
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>
1 parent 3aa4c49 commit a734d1f

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

‎net/openvswitch/datapath.c‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,8 @@ static int queue_userspace_packet(struct datapath *dp, struct sk_buff *skb,
455455
upcall->dp_ifindex = dp_ifindex;
456456

457457
err = ovs_nla_put_key(key, key, OVS_PACKET_ATTR_KEY, false, user_skb);
458-
BUG_ON(err);
458+
if (err)
459+
goto out;
459460

460461
if (upcall_info->userdata)
461462
__nla_put(user_skb, OVS_PACKET_ATTR_USERDATA,
@@ -471,7 +472,9 @@ static int queue_userspace_packet(struct datapath *dp, struct sk_buff *skb,
471472
}
472473
err = ovs_nla_put_tunnel_info(user_skb,
473474
upcall_info->egress_tun_info);
474-
BUG_ON(err);
475+
if (err)
476+
goto out;
477+
475478
nla_nest_end(user_skb, nla);
476479
}
477480

0 commit comments

Comments
 (0)