Commit b417c087 authored by Dan Carpenter's avatar Dan Carpenter Committed by Jason Gunthorpe

RDMA/hns: Fix an error code in hns_roce_set_user_sq_size()

This function is supposed to return negative kernel error codes but here
it returns CMD_RST_PRC_EBUSY (2).  The error code eventually gets passed
to IS_ERR() and since it's not an error pointer it leads to an Oops in
hns_roce_v1_rsv_lp_qp()
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
parent 7ef75875
...@@ -1098,7 +1098,7 @@ static int hns_roce_cmq_send(struct hns_roce_dev *hr_dev, ...@@ -1098,7 +1098,7 @@ static int hns_roce_cmq_send(struct hns_roce_dev *hr_dev,
if (ret == CMD_RST_PRC_SUCCESS) if (ret == CMD_RST_PRC_SUCCESS)
return 0; return 0;
if (ret == CMD_RST_PRC_EBUSY) if (ret == CMD_RST_PRC_EBUSY)
return ret; return -EBUSY;
ret = __hns_roce_cmq_send(hr_dev, desc, num); ret = __hns_roce_cmq_send(hr_dev, desc, num);
if (ret) { if (ret) {
...@@ -1106,7 +1106,7 @@ static int hns_roce_cmq_send(struct hns_roce_dev *hr_dev, ...@@ -1106,7 +1106,7 @@ static int hns_roce_cmq_send(struct hns_roce_dev *hr_dev,
if (retval == CMD_RST_PRC_SUCCESS) if (retval == CMD_RST_PRC_SUCCESS)
return 0; return 0;
else if (retval == CMD_RST_PRC_EBUSY) else if (retval == CMD_RST_PRC_EBUSY)
return retval; return -EBUSY;
} }
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment