]> git.baikalelectronics.ru Git - kernel.git/commit
xfrm: do not call rcu_read_unlock when afinfo is NULL in xfrm_get_tos
authorXin Long <lucien.xin@gmail.com>
Sat, 17 Feb 2018 07:16:22 +0000 (15:16 +0800)
committerSteffen Klassert <steffen.klassert@secunet.com>
Mon, 19 Feb 2018 07:45:25 +0000 (08:45 +0100)
commit453cd3a79bc42e2f1ba97798d46dff1a1436ce57
treebe8531f260c9bec64a3f54255633769ac402ffdc
parentbc5530a65a19c8ee20bd702cbfaf1233a9433f75
xfrm: do not call rcu_read_unlock when afinfo is NULL in xfrm_get_tos

When xfrm_policy_get_afinfo returns NULL, it will not hold rcu
read lock. In this case, rcu_read_unlock should not be called
in xfrm_get_tos, just like other places where it's calling
xfrm_policy_get_afinfo.

Fixes: 1924d7a7405c ("xfrm: policy: xfrm_get_tos cannot fail")
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
net/xfrm/xfrm_policy.c