提交 73096fd8 编写于 作者: E Eelco Chaudron 提交者: Xie XiuQi

net: openvswitch: return an error instead of doing BUG_ON()

mainline inclusion
from mainline-5.1
commit a734d1f4c2fc
category: bugfix
bugzilla: 15155
CVE: NA

-------------------------------------------------

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: NDavide Caratti <dcaratti@redhat.com>
Signed-off-by: NEelco Chaudron <echaudro@redhat.com>
Acked-by: NFlavio Leitner <fbl@sysclose.org>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
Signed-off-by: NZhiqiang Liu <liuzhiqiang26@huawei.com>
Reviewed-by: NWenan Mao <maowenan@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 cc08d60a
......@@ -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,
......@@ -470,7 +471,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);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册