xfrm: change secpath_set to return secpath struct, not error value
authorFlorian Westphal <fw@strlen.de>
Tue, 18 Dec 2018 16:15:18 +0000 (17:15 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 19 Dec 2018 19:21:37 +0000 (11:21 -0800)
commit0ca64da128b816b2826e9b469f47239c47f1df31
tree1772b09b0ce8f686851f3a854777e2b2001ea1f1
parentde8bda1d22d38b7d5cd08b33f86efd94d4c86630
xfrm: change secpath_set to return secpath struct, not error value

It can only return 0 (success) or -ENOMEM.
Change return value to a pointer to secpath struct.

This avoids direct access to skb->sp:

err = secpath_set(skb);
if (!err) ..
skb->sp-> ...

Becomes:
sp = secpath_set(skb)
if (!sp) ..
sp-> ..

This reduces noise in followup patch which is going to remove skb->sp.

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/xfrm.h
net/ipv4/esp4_offload.c
net/ipv6/esp6_offload.c
net/ipv6/xfrm6_input.c
net/xfrm/xfrm_input.c