mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 03:40:35 +09:00
drm/amd/display: prevent memory leak
[ Upstream commit 104c307147 ]
In dcn*_create_resource_pool the allocated memory should be released if
construct pool fails.
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
e0cf3ebfcf
commit
60e1b411bf
@@ -1001,6 +1001,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;
|
||||
}
|
||||
|
||||
@@ -1344,6 +1344,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;
|
||||
}
|
||||
|
||||
@@ -1287,6 +1287,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;
|
||||
}
|
||||
|
||||
@@ -1076,6 +1076,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;
|
||||
}
|
||||
|
||||
@@ -1361,6 +1361,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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user