mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
clk: mmp: Use common error handling code in mmp_clk_register_mix()
Add a jump target so that a bit of exception handling can be better reused at the end of this function. Signed-off-by: Markus Elfring <[email protected]> Signed-off-by: Stephen Boyd <[email protected]>
This commit is contained in:
parent
1cc36f7300
commit
e9baa27994
1 changed files with 8 additions and 6 deletions
|
|
@ -464,10 +464,9 @@ struct clk *mmp_clk_register_mix(struct device *dev,
|
|||
if (config->table) {
|
||||
table_bytes = sizeof(*config->table) * config->table_size;
|
||||
mix->table = kmemdup(config->table, table_bytes, GFP_KERNEL);
|
||||
if (!mix->table) {
|
||||
kfree(mix);
|
||||
return ERR_PTR(-ENOMEM);
|
||||
}
|
||||
if (!mix->table)
|
||||
goto free_mix;
|
||||
|
||||
mix->table_size = config->table_size;
|
||||
}
|
||||
|
||||
|
|
@ -477,8 +476,7 @@ struct clk *mmp_clk_register_mix(struct device *dev,
|
|||
GFP_KERNEL);
|
||||
if (!mix->mux_table) {
|
||||
kfree(mix->table);
|
||||
kfree(mix);
|
||||
return ERR_PTR(-ENOMEM);
|
||||
goto free_mix;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -502,4 +500,8 @@ struct clk *mmp_clk_register_mix(struct device *dev,
|
|||
}
|
||||
|
||||
return clk;
|
||||
|
||||
free_mix:
|
||||
kfree(mix);
|
||||
return ERR_PTR(-ENOMEM);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue