Message ID | 57d92940.6329c80a.3d959.9d78@mx.google.com (mailing list archive) |
---|---|
State | Changes Requested, archived |
Delegated to: | Stephen Boyd |
Headers | show |
On 09/14, arvind.yadav.cs@gmail.com wrote: > @@ -337,6 +339,8 @@ static void __init st_of_flexgen_setup(struct device_node *np) > return; > > err: > + if (reg) This is always true? Why check? > + iounmap(reg); > if (clk_data) > kfree(clk_data->clks); > kfree(clk_data); > -- > 1.7.9.5 >
On Wednesday 14 September 2016 11:54 PM, Stephen Boyd wrote: > On 09/14, arvind.yadav.cs@gmail.com wrote: >> @@ -337,6 +339,8 @@ static void __init st_of_flexgen_setup(struct device_node *np) >> return; >> >> err: >> + if (reg) > This is always true? Why check? > I have removed this check. Please review updated patch. >> + iounmap(reg); >> if (clk_data) >> kfree(clk_data->clks); >> kfree(clk_data); >> -- >> 1.7.9.5 >> -- To unsubscribe from this list: send the line "unsubscribe linux-clk" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/drivers/clk/st/clk-flexgen.c b/drivers/clk/st/clk-flexgen.c index 546bd79..af8df7b 100644 --- a/drivers/clk/st/clk-flexgen.c +++ b/drivers/clk/st/clk-flexgen.c @@ -278,8 +278,10 @@ static void __init st_of_flexgen_setup(struct device_node *np) return; parents = flexgen_get_parents(np, &num_parents); - if (!parents) + if (!parents) { + iounmap(reg); return; + } clk_data = kzalloc(sizeof(*clk_data), GFP_KERNEL); if (!clk_data) @@ -337,6 +339,8 @@ static void __init st_of_flexgen_setup(struct device_node *np) return; err: + if (reg) + iounmap(reg); if (clk_data) kfree(clk_data->clks); kfree(clk_data);