bus: mhi: core: Fix a NULL vs IS_ERR check in mhi_create_devices()
Subsystems (3)
PATCH 1/1 bus: mhi: core: Fix a NULL vs IS_ERR check in mhi_create_devices()
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 <[email protected]>
--- drivers/bus/mhi/core/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/bus/mhi/core/main.c +1 -1
@@ -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 ;
Signature · 1 line
2.25.1
Quoted 5 lines · Dan Carpenter
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 <[email protected]>
Thanks Dan!
Regards,
Mani
Quoted 20 lines
--- drivers/bus/mhi/core/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/bus/mhi/core/main.c +1
-1@@ -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 ;Signature · 1 line
2.25.1