mlxsw: spectrum: Fix error return code in mlxsw_sp_port_create()
authorWei Yongjun <weiyongjun1@huawei.com>
Mon, 6 Nov 2017 11:11:28 +0000 (11:11 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 8 Nov 2017 04:25:15 +0000 (13:25 +0900)
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum.c

index 1497b436be781b23a0b3986a1a409c8330223e31..b2cd1ebf4e3677b5d01181b99c34a69023ed4c9e 100644 (file)
@@ -3043,6 +3043,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;
        }