mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] bus: mhi: core: Fix a NULL vs IS_ERR check in mhi_create_devices()
@ 2020-04-07  9:31 Dan Carpenter
  2020-04-07 10:46 ` Manivannan Sadhasivam
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2020-04-07  9:31 UTC (permalink / raw)
  To: Manivannan Sadhasivam
  Cc: Hemant Kumar, Jeffrey Hugo, Greg Kroah-Hartman,
	Siddartha Mohanadoss, Sujeev Dias, linux-arm-msm, linux-kernel,
	kernel-janitors

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(-)

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-04-07 10:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-07  9:31 [PATCH] bus: mhi: core: Fix a NULL vs IS_ERR check in mhi_create_devices() Dan Carpenter
2020-04-07 10:46 ` Manivannan Sadhasivam

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®