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: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
This commit is contained in:
parent
74c0554ac7
commit
06f7d79317
@ -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),
|
struct dss_conv_node *n = kmalloc(sizeof(struct dss_conv_node),
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
n->node = node;
|
if (n) {
|
||||||
n->root = root;
|
n->node = node;
|
||||||
list_add(&n->list, &dss_conv_list);
|
n->root = root;
|
||||||
|
list_add(&n->list, &dss_conv_list);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool __init omapdss_list_contains(const struct device_node *node)
|
static bool __init omapdss_list_contains(const struct device_node *node)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user