From: Christophe Jaillet Date: Sat, 24 Sep 2016 20:07:30 +0000 (+0200) Subject: drm/tegra: sor: No need to free devm_ allocated memory X-Git-Tag: v4.14-rc1~1925^2~1^2~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4141e7448b501227967ff274af5f4eadadb6068b;p=platform%2Fkernel%2Flinux-rpi.git drm/tegra: sor: No need to free devm_ allocated memory 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 Signed-off-by: Thierry Reding --- diff --git a/drivers/gpu/drm/tegra/sor.c b/drivers/gpu/drm/tegra/sor.c index 74d0540..a8f5289 100644 --- a/drivers/gpu/drm/tegra/sor.c +++ b/drivers/gpu/drm/tegra/sor.c @@ -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; }