diff options
author | Christophe Jaillet <christophe.jaillet@wanadoo.fr> | 2016-07-14 06:18:45 (GMT) |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-07-15 05:14:54 (GMT) |
commit | a1e3e7372c54fb74994a9cb72965d6e9b4c2efda (patch) | |
tree | 43c52d75dbffeda2c31e925dd3565acbf6b08ca9 | |
parent | e6dab9021f13ad961aadb24770931e30e90e8aa7 (diff) | |
download | linux-a1e3e7372c54fb74994a9cb72965d6e9b4c2efda.tar.xz |
mlxsw: spectrum_router: Return -ENOENT in case of error
'vr' should be a valid pointer here, so returning 'PTR_ERR(vr)' is wrong.
Return an explicit error code (-ENOENT) instead.
Fixes: 61c503f976 ("mlxsw: spectrum_router: Implement fib4 add/del switchdev obj ops")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c index e084ea5..81418d6 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c @@ -1803,7 +1803,7 @@ int mlxsw_sp_router_fib4_del(struct mlxsw_sp_port *mlxsw_sp_port, sizeof(fib4->dst), fib4->dst_len); if (!fib_entry) { dev_warn(mlxsw_sp->bus_info->dev, "Failed to find FIB4 entry being removed.\n"); - return PTR_ERR(vr); + return -ENOENT; } mlxsw_sp_fib_entry_del(mlxsw_sp_port->mlxsw_sp, fib_entry); mlxsw_sp_fib_entry_remove(vr->fib, fib_entry); |