Commit 1ea34b29 authored by Wei Yongjun's avatar Wei Yongjun Committed by Greg Kroah-Hartman

bus: mhi: core: Fix some error return code

Fix to return negative error code from the error handling case
instead of 0 in mhi_init_dev_ctxt() and mhi_driver_probe().

Fixes: 3000f85b ("bus: mhi: core: Add support for basic PM operations")
Reported-by: default avatarHulk Robot <hulkci@huawei.com>
Signed-off-by: default avatarWei Yongjun <weiyongjun1@huawei.com>
Reviewed-by: default avatarManivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Link: https://lore.kernel.org/r/20200509075654.175002-1-weiyongjun1@huawei.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 13331747
...@@ -291,6 +291,7 @@ int mhi_init_dev_ctxt(struct mhi_controller *mhi_cntrl) ...@@ -291,6 +291,7 @@ int mhi_init_dev_ctxt(struct mhi_controller *mhi_cntrl)
} }
/* Setup cmd context */ /* Setup cmd context */
ret = -ENOMEM;
mhi_ctxt->cmd_ctxt = mhi_alloc_coherent(mhi_cntrl, mhi_ctxt->cmd_ctxt = mhi_alloc_coherent(mhi_cntrl,
sizeof(*mhi_ctxt->cmd_ctxt) * sizeof(*mhi_ctxt->cmd_ctxt) *
NR_OF_CMD_RINGS, NR_OF_CMD_RINGS,
...@@ -1100,6 +1101,7 @@ static int mhi_driver_probe(struct device *dev) ...@@ -1100,6 +1101,7 @@ static int mhi_driver_probe(struct device *dev)
} }
} }
ret = -EINVAL;
if (dl_chan) { if (dl_chan) {
/* /*
* If channel supports LPM notifications then status_cb should * If channel supports LPM notifications then status_cb should
......
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