提交 a3df633a 编写于 作者: V Vlad Buslov 提交者: David S. Miller

net: sched: act_tunnel_key: fix NULL pointer dereference during init

Metadata pointer is only initialized for action TCA_TUNNEL_KEY_ACT_SET, but
it is unconditionally dereferenced in tunnel_key_init() error handler.
Verify that metadata pointer is not NULL before dereferencing it in
tunnel_key_init error handling code.

Fixes: ee28bb56 ("net/sched: fix memory leak in act_tunnel_key_init()")
Signed-off-by: NVlad Buslov <vladbu@mellanox.com>
Reviewed-by: NDavide Caratti <dcaratti@redhat.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 9919a363
......@@ -377,7 +377,8 @@ static int tunnel_key_init(struct net *net, struct nlattr *nla,
return ret;
release_tun_meta:
dst_release(&metadata->dst);
if (metadata)
dst_release(&metadata->dst);
err_out:
if (exists)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册