projects
/
firefly-linux-kernel-4.4.55.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0f1b414
)
ACPI / resources: free memory on error in add_region_before()
author
Dan Carpenter
<dan.carpenter@oracle.com>
Wed, 24 Jun 2015 14:30:15 +0000
(17:30 +0300)
committer
Rafael J. Wysocki
<rafael.j.wysocki@intel.com>
Wed, 24 Jun 2015 17:52:34 +0000
(19:52 +0200)
There is a small memory leak on error.
Fixes: 0f1b414d1907 (ACPI / PNP: Avoid conflicting resource reservations)
Cc: All applicable <stable@vger.kernel.org>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/resource.c
patch
|
blob
|
history
diff --git
a/drivers/acpi/resource.c
b/drivers/acpi/resource.c
index fcb7807ea8b73de79163bb99c20091f4b202da0d..10561ce16ed135165cdbc8e558cb2aaea263d13b 100644
(file)
--- a/
drivers/acpi/resource.c
+++ b/
drivers/acpi/resource.c
@@
-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;