Browse Source

clk: vexpress: NULL dereference on error path

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>
Dan Carpenter 11 years ago
parent
commit
6b4ed8b00e
1 changed files with 1 additions and 1 deletions
  1. 1 1
      drivers/clk/versatile/clk-vexpress-osc.c

+ 1 - 1
drivers/clk/versatile/clk-vexpress-osc.c

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