Skip to content

bonding: fix enslaving a dev without mtu setting support

Veaceslav Falico netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2bonding: populate essential new_slave->bond/dev earlydrivers/net/bonding/bond_main.c+2 -21 reply
2/2bonding: remove NULL verification from bond_get_bond_by_slave()drivers/net/bonding/bonding.h+0 -20 replies

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by.

PatchDing Tianhong
1/2A-b
2/2

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH net-next 0/2] bonding: fix enslaving a dev without mtu setting support

Hi,

With the introduction of bond_free_slave() we need to have slave->bond populated before calling it, however if the dev_mtu_set(slave, mtu) fails, we call bond_free_slave() before actually setting slave->bond, and thus we'll panic.

Fix this by populating slave->bond (and ->dev, it seems appropriate) as early as possible.

Also, remove a harmful check for NULL in bond_get_bond_by_slave(), as it's only hiding the real problem and making it harder to debug.

---
 drivers/net/bonding/bond_main.c | 4 ++--
 drivers/net/bonding/bonding.h   | 2 --
 2 files changed, 2 insertions(+), 4 deletions(-)