Skip to content

Commit

Permalink
clk: vexpress: NULL dereference on error path
Browse files Browse the repository at this point in the history
If the allocation fails then we dereference the NULL in the error path.
Just return directly.

Fixes: ed27ff1 ('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>
  • Loading branch information
Dan Carpenter authored and Pawel Moll committed Apr 24, 2014
1 parent a798c10 commit 6b4ed8b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/clk/versatile/clk-vexpress-osc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 6b4ed8b

Please sign in to comment.