Skip to content

Commit 522587e

Browse files
Dan Carpentergregkh
authored andcommitted
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: da1c4f8 ("bus: mhi: core: Add support for creating and destroying MHI devices") Signed-off-by: Dan Carpenter <[email protected]> Acked-by: Manivannan Sadhasivam <[email protected]> Link: https://lore.kernel.org/r/20200407093133.GM68494@mwanda Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 6a8b55e commit 522587e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/bus/mhi/core/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ void mhi_create_devices(struct mhi_controller *mhi_cntrl)
294294
!(mhi_chan->ee_mask & BIT(mhi_cntrl->ee)))
295295
continue;
296296
mhi_dev = mhi_alloc_device(mhi_cntrl);
297-
if (!mhi_dev)
297+
if (IS_ERR(mhi_dev))
298298
return;
299299

300300
mhi_dev->dev_type = MHI_DEVICE_XFER;

0 commit comments

Comments
 (0)