⬢ DragonFlyBSD Kernel Audit
DF-4318 / fix.diff
← back to finding ↓ download raw
--- a/sys/dev/drm/amd/display/dc/dce80/dce80_resource.c
+++ b/sys/dev/drm/amd/display/dc/dce80/dce80_resource.c
@@ -1062,8 +1062,10 @@ struct resource_pool *dce80_create_resource_pool(
 	if (dce80_construct(num_virtual_links, dc, pool))
 		return &pool->base;
 
+	kfree(pool);
 	BREAK_TO_DEBUGGER();
 	return NULL;
 }
@@ -1272,8 +1274,10 @@ struct resource_pool *dce81_create_resource_pool(
 	if (dce81_construct(num_virtual_links, dc, pool))
 		return &pool->base;
 
+	kfree(pool);
 	BREAK_TO_DEBUGGER();
 	return NULL;
 }
@@ -1478,8 +1482,10 @@ struct resource_pool *dce83_create_resource_pool(
 	if (dce83_construct(num_virtual_links, dc, pool))
 		return &pool->base;
 
+	kfree(pool);
 	BREAK_TO_DEBUGGER();
 	return NULL;
 }