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

Commit 56e8402c authored by Bhaumik Bhatt's avatar Bhaumik Bhatt Committed by Gerrit - the friendly Code Review server
Browse files

mhi: core: check if controller name exists when going over list



When iterating over the list of all MHI controllers, ensure
that the name is populated to avoid seeing a NULL pointer
exception.

Change-Id: Ic04a6b9e70a6f04f1ae87713c129cb42dbe6b5c7
Signed-off-by: default avatarBhaumik Bhatt <bbhatt@codeaurora.org>
parent 6404500c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -85,7 +85,7 @@ struct mhi_controller *find_mhi_controller_by_name(const char *name)

	list_for_each_entry_safe(mhi_cntrl, tmp_cntrl, &mhi_bus.controller_list,
				 node) {
		if (!strcmp(name, mhi_cntrl->name))
		if (mhi_cntrl->name && (!strcmp(name, mhi_cntrl->name)))
			return mhi_cntrl;
	}