提交 b509cc80 编写于 作者: R Russell King

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: NSachin Kamat <sachin.kamat@samsung.com>
Tested-by: NSachin Kamat <sachin.kamat@samsung.com>
Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
上级 6955b582
......@@ -293,10 +293,12 @@ int component_master_add_with_match(struct device *dev,
if (ops->add_components && match)
return -EINVAL;
/* Reallocate the match array for its true size */
match = component_match_realloc(dev, match, match->num);
if (IS_ERR(match))
return PTR_ERR(match);
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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册