mirror of
https://github.com/torvalds/linux.git
synced 2024-12-28 13:51:44 +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
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user