drm/amd: fix potential memory leak
Subsystems (3)
PATCH 1/1 drm/amd: fix potential memory leak
This patch fix potential memory leak (clk_src) when function run into last return NULL.
Signed-off-by Bernard Zhao <[email protected]>
--- drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c +1 -0
@@ -1715,6 +1715,7 @@ static struct clock_source *dcn30_clock_source_create( }BREAK_TO_DEBUGGER (); +free (clk_src);return NULL ; }
Signature · 1 line
2.33.1
Alex Deucher
AppliedApplied. Thanks!
Quoted 24 lines · Bernard Zhao
This patch fix potential memory leak (
clk_src) when function run into last return NULL.Signed-off-by Bernard Zhao <[email protected]>--- drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c | 1 + 1 file changed, 1 insertion(+)drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c +1
-1@@ -1715,6 +1715,7 @@ static struct clock_source *dcn30_clock_source_create( }BREAK_TO_DEBUGGER (); +free (clk_src);return NULL ; } --2.33.1
Quoted 14 lines · Bernard Zhao
This patch fix potential memory leak (
clk_src) when function run into last return NULL.Signed-off-by Bernard Zhao <[email protected]>--- drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c | 1 + 1 file changed, 1 insertion(+)drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c +0
-0
drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c static struct clock_source *dcn30_clock_source_create( · line 1718
Quoted 4 lines
drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c +1
-0@@ -1715,6 +1715,7 @@ static struct clock_source *dcn30_clock_source_create( }BREAK_TO_DEBUGGER (); +free (clk_src);
This should be kfree(). Fixed up locally.
Alex
Quoted 6 lines
drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c +0
-1return NULL ; } --2.33.1