mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
de8bda1d22
commit
0ca64da128
5 changed files with 26 additions and 20 deletions
|
|
@ -46,11 +46,12 @@ static struct sk_buff *esp4_gro_receive(struct list_head *head,
|
|||
|
||||
xo = xfrm_offload(skb);
|
||||
if (!xo || !(xo->flags & CRYPTO_DONE)) {
|
||||
err = secpath_set(skb);
|
||||
if (err)
|
||||
struct sec_path *sp = secpath_set(skb);
|
||||
|
||||
if (!sp)
|
||||
goto out;
|
||||
|
||||
if (skb->sp->len == XFRM_MAX_DEPTH)
|
||||
if (sp->len == XFRM_MAX_DEPTH)
|
||||
goto out;
|
||||
|
||||
x = xfrm_state_lookup(dev_net(skb->dev), skb->mark,
|
||||
|
|
@ -59,8 +60,8 @@ static struct sk_buff *esp4_gro_receive(struct list_head *head,
|
|||
if (!x)
|
||||
goto out;
|
||||
|
||||
skb->sp->xvec[skb->sp->len++] = x;
|
||||
skb->sp->olen++;
|
||||
sp->xvec[sp->len++] = x;
|
||||
sp->olen++;
|
||||
|
||||
xo = xfrm_offload(skb);
|
||||
if (!xo) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue