Skip to content
This repository has been archived by the owner on Jan 25, 2023. It is now read-only.

Commit

Permalink
drm/amd/display: prevent memory leak
Browse files Browse the repository at this point in the history
In dcn*_create_resource_pool the allocated memory should be released if
construct pool fails.

Change-Id: I24a83555dd34f362bba3a5bd93073c589f980e81
Tracked-On: PKT-2828
Reviewed-by: Harry Wentland <[email protected]>
Signed-off-by: Navid Emamdoost <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
  • Loading branch information
Navidem authored and sgnanase committed Dec 12, 2019
1 parent bffab09 commit 15b02da
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions drivers/gpu/drm/amd/display/dc/dce100/dce100_resource.c
Original file line number Diff line number Diff line change
Expand Up @@ -1002,6 +1002,7 @@ struct resource_pool *dce100_create_resource_pool(
if (construct(num_virtual_links, dc, pool))
return &pool->base;

kfree(pool);
BREAK_TO_DEBUGGER();
return NULL;
}
Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c
Original file line number Diff line number Diff line change
Expand Up @@ -1345,6 +1345,7 @@ struct resource_pool *dce110_create_resource_pool(
if (construct(num_virtual_links, dc, pool, asic_id))
return &pool->base;

kfree(pool);
BREAK_TO_DEBUGGER();
return NULL;
}
1 change: 1 addition & 0 deletions drivers/gpu/drm/amd/display/dc/dce112/dce112_resource.c
Original file line number Diff line number Diff line change
Expand Up @@ -1288,6 +1288,7 @@ struct resource_pool *dce112_create_resource_pool(
if (construct(num_virtual_links, dc, pool))
return &pool->base;

kfree(pool);
BREAK_TO_DEBUGGER();
return NULL;
}
1 change: 1 addition & 0 deletions drivers/gpu/drm/amd/display/dc/dce120/dce120_resource.c
Original file line number Diff line number Diff line change
Expand Up @@ -1077,6 +1077,7 @@ struct resource_pool *dce120_create_resource_pool(
if (construct(num_virtual_links, dc, pool))
return &pool->base;

kfree(pool);
BREAK_TO_DEBUGGER();
return NULL;
}
1 change: 1 addition & 0 deletions drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c
Original file line number Diff line number Diff line change
Expand Up @@ -1362,6 +1362,7 @@ struct resource_pool *dcn10_create_resource_pool(
if (construct(num_virtual_links, dc, pool))
return &pool->base;

kfree(pool);
BREAK_TO_DEBUGGER();
return NULL;
}

0 comments on commit 15b02da

Please sign in to comment.