{
        struct clk_init_data *init;
        struct fapll_synth *synth;
+       struct clk *clk = ERR_PTR(-ENOMEM);
 
        init = kzalloc(sizeof(*init), GFP_KERNEL);
        if (!init)
        synth->hw.init = init;
        synth->clk_pll = pll_clk;
 
-       return clk_register(NULL, &synth->hw);
+       clk = clk_register(NULL, &synth->hw);
+       if (IS_ERR(clk)) {
+               pr_err("failed to register clock\n");
+               goto free;
+       }
+
+       return clk;
 
 free:
        kfree(synth);
        kfree(init);
 
-       return ERR_PTR(-ENOMEM);
+       return clk;
 }
 
 static void __init ti_fapll_setup(struct device_node *node)