Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7b611eec authored by Bhaumik Bhatt's avatar Bhaumik Bhatt Committed by Hemant Kumar
Browse files

mhi: core: add bus type to early notification iterator function



Iterator on device children runs into issues when bus type
check is missing. Add the check to avoid NULL pointer
exceptions.

Change-Id: Ic460b91685c6485c2991542ac1fa8c0fcfe09bb6
Signed-off-by: default avatarBhaumik Bhatt <bbhatt@codeaurora.org>
parent 2022f3d1
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -635,8 +635,14 @@ int mhi_destroy_device(struct device *dev, void *data)

int mhi_early_notify_device(struct device *dev, void *data)
{
	struct mhi_device *mhi_dev = to_mhi_device(dev);
	struct mhi_controller *mhi_cntrl = mhi_dev->mhi_cntrl;
	struct mhi_device *mhi_dev;
	struct mhi_controller *mhi_cntrl;

	if (dev->bus != &mhi_bus_type)
		return 0;

	mhi_dev = to_mhi_device(dev);
	mhi_cntrl = mhi_dev->mhi_cntrl;

	/* skip early notification */
	if (!mhi_dev->early_notif)