Commit a3df633a authored by Vlad Buslov's avatar Vlad Buslov Committed by 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: default avatarVlad Buslov <>
Reviewed-by: default avatarDavide Caratti <>
Signed-off-by: default avatarDavid S. Miller <>
parent 9919a363
......@@ -377,7 +377,8 @@ static int tunnel_key_init(struct net *net, struct nlattr *nla,
return ret;
if (metadata)
if (exists)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment