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

Commit a52f07ec authored by Grant Likely's avatar Grant Likely
Browse files

dt: protect against NULL matches passed to of_match_node()



There are a few use cases where it is convenient to pass NULL to
of_match_node() and have it fail gracefully.  The patch adds a null
check to the beginning so taht it does so.

Signed-off-by: default avatarGrant Likely <grant.likely@secretlab.ca>
parent 38e9e21d
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -496,6 +496,9 @@ EXPORT_SYMBOL(of_find_node_with_property);
const struct of_device_id *of_match_node(const struct of_device_id *matches,
					 const struct device_node *node)
{
	if (!matches)
		return NULL;

	while (matches->name[0] || matches->type[0] || matches->compatible[0]) {
		int match = 1;
		if (matches->name[0])