]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
drm/tegra: sor: No need to free devm_ allocated memory
authorChristophe Jaillet <christophe.jaillet@wanadoo.fr>
Sat, 24 Sep 2016 20:07:30 +0000 (22:07 +0200)
committerThierry Reding <treding@nvidia.com>
Mon, 7 Nov 2016 12:03:41 +0000 (13:03 +0100)
Memory for the brick clock is allocated by devm_kzalloc(), so there is
no need here to free it explicitly.

The only function that calls tegra_clk_sor_brick_register() is the probe
function and it correctly checks and handles the return value, which, on
failure, will cause devm_ allocated memory to be freed automatically.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Thierry Reding <treding@nvidia.com>
drivers/gpu/drm/tegra/sor.c

index 74d0540b8d4c797361111fb9e8b0df288811541d..a8f528925009e67938dc7e7b84b7d33b418733a3 100644 (file)
@@ -349,8 +349,6 @@ static struct clk *tegra_clk_sor_brick_register(struct tegra_sor *sor,
        brick->hw.init = &init;
 
        clk = devm_clk_register(sor->dev, &brick->hw);
-       if (IS_ERR(clk))
-               kfree(brick);
 
        return clk;
 }