From: Lijun Ou Date: Wed, 25 Jul 2018 07:29:31 +0000 (+0800) Subject: RDMA/hns: Do not overwrite the error code during error unwind in hns_roce_init X-Git-Tag: v4.19-rc1~106^2~95 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3635ac020842d37d207570891cb901afa653e55d;p=thirdparty%2Flinux.git RDMA/hns: Do not overwrite the error code during error unwind in hns_roce_init When init cmq fail in initial flow of RoCE, it should return the errno of cmq_init function, not of the rest call. Signed-off-by: Lijun Ou Signed-off-by: Jason Gunthorpe --- diff --git a/drivers/infiniband/hw/hns/hns_roce_main.c b/drivers/infiniband/hw/hns/hns_roce_main.c index 850032de86763..3ea2182a3334f 100644 --- a/drivers/infiniband/hw/hns/hns_roce_main.c +++ b/drivers/infiniband/hw/hns/hns_roce_main.c @@ -886,8 +886,7 @@ error_failed_cmd_init: error_failed_cmq_init: if (hr_dev->hw->reset) { - ret = hr_dev->hw->reset(hr_dev, false); - if (ret) + if (hr_dev->hw->reset(hr_dev, false)) dev_err(dev, "Dereset RoCE engine failed!\n"); }