mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-11-08 18:43:21 +01:00
ACPI / resources: free memory on error in add_region_before()
There is a small memory leak on error.
Fixes: 0f1b414d19 (ACPI / PNP: Avoid conflicting resource reservations)
Cc: All applicable <[email protected]>
Signed-off-by: Dan Carpenter <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
This commit is contained in:
1 parent
0f1b414d19
commit
7bc10388cc
1 file changed
+3
-1
@@ -660,8 +660,10 @@ static int add_region_before(u64 start, u64 end, u8 space_id,
|
||||
return -ENOMEM;
|
||||
|
||||
error = request_range(start, end, space_id, flags, desc);
|
||||
if (error)
|
||||
if (error) {
|
||||
kfree(reg);
|
||||
return error;
|
||||
}
|
||||
|
||||
reg->start = start;
|
||||
reg->end = end;
|
||||
|
||||
Reference in new issue
Block a user