bus: mhi: core: Fix some error return code
authorWei Yongjun <weiyongjun1@huawei.com>
Sat, 9 May 2020 07:56:54 +0000 (07:56 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 15 May 2020 14:32:20 +0000 (16:32 +0200)
Fix to return negative error code from the error handling case
instead of 0 in mhi_init_dev_ctxt() and mhi_driver_probe().

Fixes: 3000f85b8f47 ("bus: mhi: core: Add support for basic PM operations")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Link: https://lore.kernel.org/r/20200509075654.175002-1-weiyongjun1@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/bus/mhi/core/init.c

index eb2ab058a01d2ebdcd6485baa03af5096c7676a6..1f8c82603179de38ac1395b4923822cf9d7dcecb 100644 (file)
@@ -291,6 +291,7 @@ int mhi_init_dev_ctxt(struct mhi_controller *mhi_cntrl)
        }
 
        /* Setup cmd context */
+       ret = -ENOMEM;
        mhi_ctxt->cmd_ctxt = mhi_alloc_coherent(mhi_cntrl,
                                                sizeof(*mhi_ctxt->cmd_ctxt) *
                                                NR_OF_CMD_RINGS,
@@ -1100,6 +1101,7 @@ static int mhi_driver_probe(struct device *dev)
                }
        }
 
+       ret = -EINVAL;
        if (dl_chan) {
                /*
                 * If channel supports LPM notifications then status_cb should