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

Commit 06f7d793 authored by Sachin Kamat's avatar Sachin Kamat Committed by Tomi Valkeinen
Browse files

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: default avatarSachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
parent 74c0554a
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -121,10 +121,12 @@ 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);
	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)
{