OSDN Git Service

net/mlx5: Fix error return code in esw_qos_create()
authorWei Yongjun <weiyongjun1@huawei.com>
Tue, 23 Nov 2021 08:36:16 +0000 (08:36 +0000)
committerSaeed Mahameed <saeedm@nvidia.com>
Fri, 3 Dec 2021 00:53:08 +0000 (16:53 -0800)
Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.

Fixes: 85c5f7c9200e ("net/mlx5: E-switch, Create QoS on demand")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/esw/qos.c

index eead33d..11bbcd5 100644 (file)
@@ -590,6 +590,7 @@ static int esw_qos_create(struct mlx5_eswitch *esw, struct netlink_ext_ack *exta
                if (IS_ERR(esw->qos.group0)) {
                        esw_warn(dev, "E-Switch create rate group 0 failed (%ld)\n",
                                 PTR_ERR(esw->qos.group0));
+                       err = PTR_ERR(esw->qos.group0);
                        goto err_group0;
                }
        }