mlxsw: spectrum_router: Add missing rollback
authorIdo Schimmel <idosch@mellanox.com>
Wed, 12 Jul 2017 07:12:52 +0000 (09:12 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 12 Jul 2017 15:15:51 +0000 (08:15 -0700)
With this patch the error path of mlxsw_sp_nexthop_init() is symmetric
with mlxsw_sp_nexthop_fini(). Noticed during code review.

Fixes: a8c970142798 ("mlxsw: spectrum_router: Refactor nexthop init routine")
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c

index 192cb93e7669be9587d850bc3c5a661d9816af24..129afc168fd9da2f80e64300755ac01d5550dc56 100644 (file)
@@ -1790,6 +1790,7 @@ static int mlxsw_sp_nexthop_init(struct mlxsw_sp *mlxsw_sp,
        return 0;
 
 err_nexthop_neigh_init:
+       mlxsw_sp_nexthop_rif_fini(nh);
        mlxsw_sp_nexthop_remove(mlxsw_sp, nh);
        return err;
 }