diff mbox series

bus: mhi: core: Fix a NULL vs IS_ERR check in mhi_create_devices()

Message ID 20200407093133.GM68494@mwanda (mailing list archive)
State Accepted
Commit 522587e7c008c24f19ef5ef34806268992c5e5a6
Headers show
Series bus: mhi: core: Fix a NULL vs IS_ERR check in mhi_create_devices() | expand

Commit Message

Dan Carpenter April 7, 2020, 9:31 a.m. UTC
The mhi_alloc_device() function never returns NULL, it returns error
pointers.

Fixes: da1c4f856924 ("bus: mhi: core: Add support for creating and destroying MHI devices")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/bus/mhi/core/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Manivannan Sadhasivam April 7, 2020, 10:46 a.m. UTC | #1
On Tue, Apr 07, 2020 at 12:31:33PM +0300, Dan Carpenter wrote:
> The mhi_alloc_device() function never returns NULL, it returns error
> pointers.
> 
> Fixes: da1c4f856924 ("bus: mhi: core: Add support for creating and destroying MHI devices")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Acked-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

Thanks Dan!

Regards,
Mani

> ---
>  drivers/bus/mhi/core/main.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/bus/mhi/core/main.c b/drivers/bus/mhi/core/main.c
> index eb4256b81406..55928feea0c9 100644
> --- a/drivers/bus/mhi/core/main.c
> +++ b/drivers/bus/mhi/core/main.c
> @@ -294,7 +294,7 @@ void mhi_create_devices(struct mhi_controller *mhi_cntrl)
>  		    !(mhi_chan->ee_mask & BIT(mhi_cntrl->ee)))
>  			continue;
>  		mhi_dev = mhi_alloc_device(mhi_cntrl);
> -		if (!mhi_dev)
> +		if (IS_ERR(mhi_dev))
>  			return;
>  
>  		mhi_dev->dev_type = MHI_DEVICE_XFER;
> -- 
> 2.25.1
>
diff mbox series

Patch

diff --git a/drivers/bus/mhi/core/main.c b/drivers/bus/mhi/core/main.c
index eb4256b81406..55928feea0c9 100644
--- a/drivers/bus/mhi/core/main.c
+++ b/drivers/bus/mhi/core/main.c
@@ -294,7 +294,7 @@  void mhi_create_devices(struct mhi_controller *mhi_cntrl)
 		    !(mhi_chan->ee_mask & BIT(mhi_cntrl->ee)))
 			continue;
 		mhi_dev = mhi_alloc_device(mhi_cntrl);
-		if (!mhi_dev)
+		if (IS_ERR(mhi_dev))
 			return;
 
 		mhi_dev->dev_type = MHI_DEVICE_XFER;