ASoC: Tegra: Fix I2s probe failure path
Sumit Bhattacharya [Tue, 13 Dec 2011 10:45:48 +0000 (15:45 +0530)]
Don't free i2s context in I2s platform driver probe failure case
since it is statically allocated.

Change-Id: Ia1fb7e17493b8906a36e658ded925f0f414aae23
Signed-off-by: Sumit Bhattacharya <sumitb@nvidia.com>
Reviewed-on: http://git-master/r/69729
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Scott Peterson <speterson@nvidia.com>
Reviewed-by: Nikesh Oswal <noswal@nvidia.com>

sound/soc/tegra/tegra30_i2s.c

index 235a49b..76ef1a4 100644 (file)
@@ -785,7 +785,7 @@ static __devinit int tegra30_i2s_platform_probe(struct platform_device *pdev)
        if (IS_ERR(i2s->clk_i2s)) {
                dev_err(&pdev->dev, "Can't retrieve i2s clock\n");
                ret = PTR_ERR(i2s->clk_i2s);
-               goto err_free;
+               goto exit;
        }
 
        mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
@@ -827,9 +827,7 @@ err_release:
        release_mem_region(mem->start, resource_size(mem));
 err_clk_put:
        clk_put(i2s->clk_i2s);
-err_free:
-       kfree(i2s);
-
+exit:
        return ret;
 }