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

Commit b509cc80 authored by Russell King's avatar Russell King
Browse files

component: fix bug with legacy API



Sachin Kamat reports that "component: add support for component match
array" broke Exynos DRM due to a NULL pointer deref.  Fix this.

Reported-by: default avatarSachin Kamat <sachin.kamat@samsung.com>
Tested-by: default avatarSachin Kamat <sachin.kamat@samsung.com>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 6955b582
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -293,10 +293,12 @@ int component_master_add_with_match(struct device *dev,
	if (ops->add_components && match)
		return -EINVAL;

	if (match) {
		/* Reallocate the match array for its true size */
		match = component_match_realloc(dev, match, match->num);
		if (IS_ERR(match))
			return PTR_ERR(match);
	}

	master = kzalloc(sizeof(*master), GFP_KERNEL);
	if (!master)