提交 06f7d793 编写于 作者: S Sachin Kamat 提交者: Tomi Valkeinen

video: omapdss: Fix potential null pointer dereference

kmalloc can return null. Add a check to avoid potential null
pointer dereference error when the pointer is accessed later.
Signed-off-by: NSachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
上级 74c0554a
......@@ -121,9 +121,11 @@ static void __init omapdss_add_to_list(struct device_node *node, bool root)
{
struct dss_conv_node *n = kmalloc(sizeof(struct dss_conv_node),
GFP_KERNEL);
n->node = node;
n->root = root;
list_add(&n->list, &dss_conv_list);
if (n) {
n->node = node;
n->root = root;
list_add(&n->list, &dss_conv_list);
}
}
static bool __init omapdss_list_contains(const struct device_node *node)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册