drm/amd/display/dc/calcs/dce_calcs: Fix a memleak in calculate_bandwidth()
In calculate_bandwidth(), the tag free_sclk and free_yclk are reversed,
which could lead to a memory leak of yclk.
Fix this bug by changing the location of free_sclk and free_yclk.
This bug was found by a static analyzer.
Builds with 'make allyesconfig' show no new warnings,
and our static analyzer no longer warns about this code.
Fixes: 2be8989d0f
("drm/amd/display/dc/calcs/dce_calcs: Move some large variables from the stack to the heap")
Signed-off-by: Zhou Qingyang <zhou1615@umn.edu>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
82c3a7a5ed
commit
153a9529d7
@ -2033,10 +2033,10 @@ static void calculate_bandwidth(
|
|||||||
kfree(surface_type);
|
kfree(surface_type);
|
||||||
free_tiling_mode:
|
free_tiling_mode:
|
||||||
kfree(tiling_mode);
|
kfree(tiling_mode);
|
||||||
free_yclk:
|
|
||||||
kfree(yclk);
|
|
||||||
free_sclk:
|
free_sclk:
|
||||||
kfree(sclk);
|
kfree(sclk);
|
||||||
|
free_yclk:
|
||||||
|
kfree(yclk);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
|
Loading…
Reference in New Issue
Block a user