mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-03 07:38:10 +00:00
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: Sachin Kamat <sachin.kamat@samsung.com> Tested-by: Sachin Kamat <sachin.kamat@samsung.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
This commit is contained in:
parent
6955b58254
commit
b509cc8022
1 changed files with 6 additions and 4 deletions
|
@ -293,10 +293,12 @@ int component_master_add_with_match(struct device *dev,
|
||||||
if (ops->add_components && match)
|
if (ops->add_components && match)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
/* Reallocate the match array for its true size */
|
if (match) {
|
||||||
match = component_match_realloc(dev, match, match->num);
|
/* Reallocate the match array for its true size */
|
||||||
if (IS_ERR(match))
|
match = component_match_realloc(dev, match, match->num);
|
||||||
return PTR_ERR(match);
|
if (IS_ERR(match))
|
||||||
|
return PTR_ERR(match);
|
||||||
|
}
|
||||||
|
|
||||||
master = kzalloc(sizeof(*master), GFP_KERNEL);
|
master = kzalloc(sizeof(*master), GFP_KERNEL);
|
||||||
if (!master)
|
if (!master)
|
||||||
|
|
Loading…
Reference in a new issue