From: Dan Carpenter Date: Tue, 7 Apr 2020 09:31:33 +0000 (+0300) Subject: bus: mhi: core: Fix a NULL vs IS_ERR check in mhi_create_devices() X-Git-Tag: v5.10.7~2664^2~10 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=522587e7c008c24f19ef5ef34806268992c5e5a6;p=platform%2Fkernel%2Flinux-rpi.git 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 Acked-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20200407093133.GM68494@mwanda Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/bus/mhi/core/main.c b/drivers/bus/mhi/core/main.c index eb4256b..55928fe 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;