Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <christophe.jaillet@wanadoo.fr>
Signed-off-by: Thierry Reding <treding@nvidia.com>

authored by

Christophe Jaillet and committed by
Thierry Reding
4141e744 87ba3e15

-2
-2
drivers/gpu/drm/tegra/sor.c
··· 349 349 brick->hw.init = &init; 350 350 351 351 clk = devm_clk_register(sor->dev, &brick->hw); 352 - if (IS_ERR(clk)) 353 - kfree(brick); 354 352 355 353 return clk; 356 354 }