net: sched: act_tunnel_key: fix NULL pointer dereference during init
authorVlad Buslov <vladbu@mellanox.com>
Mon, 25 Feb 2019 15:28:27 +0000 (17:28 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 10 Mar 2019 06:17:20 +0000 (07:17 +0100)
commit3846080998b93b300237ed8cef5694f8cec5a4d0
treed7758c0dc959783ccab138bec07eed0bfcf07793
parent69e6fb1804cf679457d384e1bfc519a1f1da9553
net: sched: act_tunnel_key: fix NULL pointer dereference during init

[ Upstream commit a3df633a3c92bb96b06552c3f828d7c267774379 ]

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: ee28bb56ac5b ("net/sched: fix memory leak in act_tunnel_key_init()")
Signed-off-by: Vlad Buslov <vladbu@mellanox.com>
Reviewed-by: Davide Caratti <dcaratti@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/sched/act_tunnel_key.c