net/mlx5e: Fix error handling when refreshing TIRs
authorGavi Teitz <gavi@mellanox.com>
Mon, 11 Mar 2019 09:56:34 +0000 (11:56 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Apr 2019 06:38:42 +0000 (08:38 +0200)
commit9441317513b726864375b3d26c98d371417a13ec
treeea0a4ee76b1e1c4adbb937c72908aa581cde1bb2
parent0516ef27ddba5d46c6879fe5136fbdef441d9047
net/mlx5e: Fix error handling when refreshing TIRs

[ Upstream commit bc87a0036826a37b43489b029af8143bd07c6cca ]

Previously, a false positive would be caught if the TIRs list is
empty, since the err value was initialized to -ENOMEM, and was only
updated if a TIR is refreshed. This is resolved by initializing the
err value to zero.

Fixes: b676f653896a ("net/mlx5e: Refactor refresh TIRs")
Signed-off-by: Gavi Teitz <gavi@mellanox.com>
Reviewed-by: Roi Dayan <roid@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/en_common.c