From: Ido Schimmel Date: Tue, 17 Nov 2020 17:47:02 +0000 (+0200) Subject: mlxsw: spectrum_router: Only clear offload indication from valid IPv6 FIB info X-Git-Tag: v5.11-rc1~169^2~232^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a9a711a3f78ba38badd32d1a06f844bc44863840;p=thirdparty%2Flinux.git mlxsw: spectrum_router: Only clear offload indication from valid IPv6 FIB info When the IPv6 FIB info has a nexthop object, the nexthop offload indication is set on the nexthop object and not on the FIB info itself. Therefore, do not try to clear the offload indication from the FIB info when it has a nexthop object. Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: Jakub Kicinski --- diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c index 49cd6eba0661c..645ec70314d2e 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c @@ -5324,7 +5324,8 @@ static void mlxsw_sp_rt6_destroy(struct mlxsw_sp_rt6 *mlxsw_sp_rt6) { struct fib6_nh *fib6_nh = mlxsw_sp_rt6->rt->fib6_nh; - fib6_nh->fib_nh_flags &= ~RTNH_F_OFFLOAD; + if (!mlxsw_sp_rt6->rt->nh) + fib6_nh->fib_nh_flags &= ~RTNH_F_OFFLOAD; mlxsw_sp_rt6_release(mlxsw_sp_rt6->rt); kfree(mlxsw_sp_rt6); }