kernel_samsung_a53x/drivers/net/bonding
Zhengchao Shao e6f5305d38 bonding: return -ENOMEM instead of BUG in alb_upper_dev_walk
[ Upstream commit d6b83f1e3707c4d60acfa58afd3515e17e5d5384 ]

If failed to allocate "tags" or could not find the final upper device from
start_dev's upper list in bond_verify_device_path(), only the loopback
detection of the current upper device should be affected, and the system is
no need to be panic.
So return -ENOMEM in alb_upper_dev_walk to stop walking, print some warn
information when failed to allocate memory for vlan tags in
bond_verify_device_path.

I also think that the following function calls
netdev_walk_all_upper_dev_rcu
---->>>alb_upper_dev_walk
---------->>>bond_verify_device_path
From this way, "end device" can eventually be obtained from "start device"
in bond_verify_device_path, IS_ERR(tags) could be instead of
IS_ERR_OR_NULL(tags) in alb_upper_dev_walk.

Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
Acked-by: Jay Vosburgh <jay.vosburgh@canonical.com>
Link: https://lore.kernel.org/r/20231118081653.1481260-1-shaozhengchao@huawei.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-18 12:13:12 +01:00
..
bond_3ad.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bond_alb.c bonding: return -ENOMEM instead of BUG in alb_upper_dev_walk 2024-11-18 12:13:12 +01:00
bond_debugfs.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bond_main.c bonding: return -ENOMEM instead of BUG in alb_upper_dev_walk 2024-11-18 12:13:12 +01:00
bond_netlink.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bond_options.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bond_procfs.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bond_sysfs.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bond_sysfs_slave.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bonding_priv.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Makefile Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00