]> Pileus Git - ~andy/linux/blobdiff - drivers/mfd/wm8350-core.c
Merge branch 'for-linus' of git://github.com/tiwai/sound
[~andy/linux] / drivers / mfd / wm8350-core.c
index b5807484b4c92424e04b7232c5ab41b3b020db95..e81cc31e42020a8ceff6620d73b3f251ca6aeffd 100644 (file)
@@ -536,6 +536,7 @@ static int wm8350_create_cache(struct wm8350 *wm8350, int type, int mode)
        }
 
 out:
+       kfree(wm8350->reg_cache);
        return ret;
 }
 
@@ -700,7 +701,7 @@ int wm8350_device_init(struct wm8350 *wm8350, int irq,
 
        ret = wm8350_irq_init(wm8350, irq, pdata);
        if (ret < 0)
-               goto err;
+               goto err_free;
 
        if (wm8350->irq_base) {
                ret = request_threaded_irq(wm8350->irq_base +
@@ -738,8 +739,9 @@ int wm8350_device_init(struct wm8350 *wm8350, int irq,
 
 err_irq:
        wm8350_irq_exit(wm8350);
-err:
+err_free:
        kfree(wm8350->reg_cache);
+err:
        return ret;
 }
 EXPORT_SYMBOL_GPL(wm8350_device_init);