clk: vexpress: NULL dereference on error path
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 7 Nov 2013 08:08:44 +0000 (08:08 +0000)
committerPawel Moll <pawel.moll@arm.com>
Thu, 24 Apr 2014 10:39:06 +0000 (11:39 +0100)
If the allocation fails then we dereference the NULL in the error path.
Just return directly.

Fixes: ed27ff1db869 ('clk: Versatile Express clock generators ("osc") driver')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Pawel Moll <pawel.moll@arm.com>
drivers/clk/versatile/clk-vexpress-osc.c

index 2dc8b41a339dba3dc359e7ee34b10de98e8eb3fe..a535c7bf85745144a99d86ff86fc27c0399ff8ab 100644 (file)
@@ -102,7 +102,7 @@ void __init vexpress_osc_of_setup(struct device_node *node)
 
        osc = kzalloc(sizeof(*osc), GFP_KERNEL);
        if (!osc)
-               goto error;
+               return;
 
        osc->func = vexpress_config_func_get_by_node(node);
        if (!osc->func) {