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

Configure Feed

Select the types of activity you want to include in your feed.

drm/amd/display: prevent memory leak

In dce6(0,1,4)_create_resource_pool and dce80_create_resource_pool
the allocated memory should be released if construct pool fails.

Reviewed-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: gehao <gehao@kylinos.cn>
Signed-off-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

gehao and committed by
Alex Deucher
d232afb1 58ddbecb

+5
+3
drivers/gpu/drm/amd/display/dc/dce60/dce60_resource.c
··· 1128 1128 if (dce60_construct(num_virtual_links, dc, pool)) 1129 1129 return &pool->base; 1130 1130 1131 + kfree(pool); 1131 1132 BREAK_TO_DEBUGGER(); 1132 1133 return NULL; 1133 1134 } ··· 1326 1325 if (dce61_construct(num_virtual_links, dc, pool)) 1327 1326 return &pool->base; 1328 1327 1328 + kfree(pool); 1329 1329 BREAK_TO_DEBUGGER(); 1330 1330 return NULL; 1331 1331 } ··· 1520 1518 if (dce64_construct(num_virtual_links, dc, pool)) 1521 1519 return &pool->base; 1522 1520 1521 + kfree(pool); 1523 1522 BREAK_TO_DEBUGGER(); 1524 1523 return NULL; 1525 1524 }
+2
drivers/gpu/drm/amd/display/dc/dce80/dce80_resource.c
··· 1137 1137 if (dce80_construct(num_virtual_links, dc, pool)) 1138 1138 return &pool->base; 1139 1139 1140 + kfree(pool); 1140 1141 BREAK_TO_DEBUGGER(); 1141 1142 return NULL; 1142 1143 } ··· 1337 1336 if (dce81_construct(num_virtual_links, dc, pool)) 1338 1337 return &pool->base; 1339 1338 1339 + kfree(pool); 1340 1340 BREAK_TO_DEBUGGER(); 1341 1341 return NULL; 1342 1342 }