Skip to content

Commit fc59b9a

Browse files
NikAleksandrovPaolo Abeni
authored andcommitted
bonding: fix bond_ipsec_offload_ok return type
Fix the return type which should be bool. Fixes: 955b785 ("bonding: fix suspicious RCU usage in bond_ipsec_offload_ok()") Signed-off-by: Nikolay Aleksandrov <[email protected]> Reviewed-by: Hangbin Liu <[email protected]> Signed-off-by: Paolo Abeni <[email protected]>
1 parent 4b3e33f commit fc59b9a

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

drivers/net/bonding/bond_main.c

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -599,34 +599,28 @@ static bool bond_ipsec_offload_ok(struct sk_buff *skb, struct xfrm_state *xs)
599599
struct net_device *real_dev;
600600
struct slave *curr_active;
601601
struct bonding *bond;
602-
int err;
602+
bool ok = false;
603603

604604
bond = netdev_priv(bond_dev);
605605
rcu_read_lock();
606606
curr_active = rcu_dereference(bond->curr_active_slave);
607607
real_dev = curr_active->dev;
608608

609-
if (BOND_MODE(bond) != BOND_MODE_ACTIVEBACKUP) {
610-
err = false;
609+
if (BOND_MODE(bond) != BOND_MODE_ACTIVEBACKUP)
611610
goto out;
612-
}
613611

614-
if (!xs->xso.real_dev) {
615-
err = false;
612+
if (!xs->xso.real_dev)
616613
goto out;
617-
}
618614

619615
if (!real_dev->xfrmdev_ops ||
620616
!real_dev->xfrmdev_ops->xdo_dev_offload_ok ||
621-
netif_is_bond_master(real_dev)) {
622-
err = false;
617+
netif_is_bond_master(real_dev))
623618
goto out;
624-
}
625619

626-
err = real_dev->xfrmdev_ops->xdo_dev_offload_ok(skb, xs);
620+
ok = real_dev->xfrmdev_ops->xdo_dev_offload_ok(skb, xs);
627621
out:
628622
rcu_read_unlock();
629-
return err;
623+
return ok;
630624
}
631625

632626
static const struct xfrmdev_ops bond_xfrmdev_ops = {

0 commit comments

Comments
 (0)