diff mbox series

[net-next] mlxsw: spectrum: Fix error return code in mlxsw_sp_port_create()

Message ID 1509966688-76298-1-git-send-email-weiyongjun1@huawei.com
State Accepted, archived
Delegated to: David Miller
Headers show
Series [net-next] mlxsw: spectrum: Fix error return code in mlxsw_sp_port_create() | expand

Commit Message

Wei Yongjun Nov. 6, 2017, 11:11 a.m. UTC
Fix to return a negative error code from the VID  create error handling
case instead of 0, as done elsewhere in this function.

Fixes: c57529e1d5d8 ("mlxsw: spectrum: Replace vPorts with Port-VLAN")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Ido Schimmel Nov. 6, 2017, 11:54 a.m. UTC | #1
On Mon, Nov 06, 2017 at 11:11:28AM +0000, Wei Yongjun wrote:
> Fix to return a negative error code from the VID  create error handling
> case instead of 0, as done elsewhere in this function.
> 
> Fixes: c57529e1d5d8 ("mlxsw: spectrum: Replace vPorts with Port-VLAN")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>

Reviewed-by: Ido Schimmel <idosch@mellanox.com>

Thanks
David Miller Nov. 8, 2017, 4:26 a.m. UTC | #2
From: Wei Yongjun <weiyongjun1@huawei.com>
Date: Mon, 6 Nov 2017 11:11:28 +0000

> Fix to return a negative error code from the VID  create error handling
> case instead of 0, as done elsewhere in this function.
> 
> Fixes: c57529e1d5d8 ("mlxsw: spectrum: Replace vPorts with Port-VLAN")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>

Applied.
diff mbox series

Patch

diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
index 63e5087..6c604c6 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
@@ -3007,6 +3007,7 @@  static int mlxsw_sp_port_create(struct mlxsw_sp *mlxsw_sp, u8 local_port,
 	if (IS_ERR(mlxsw_sp_port_vlan)) {
 		dev_err(mlxsw_sp->bus_info->dev, "Port %d: Failed to create VID 1\n",
 			mlxsw_sp_port->local_port);
+		err = PTR_ERR(mlxsw_sp_port_vlan);
 		goto err_port_vlan_get;
 	}