summaryrefslogtreecommitdiffstats
path: root/drivers/acpi
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2015-06-24 19:52:54 +0200
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2015-06-24 19:52:54 +0200
commit11f68686065a5634b09b374e988eb82c83a34d24 (patch)
tree7e900eafc70f58a0234a3079059a015f2b3d3733 /drivers/acpi
parent43c9fad942b5afb9e03801c0721d83160fa5b0dd (diff)
parent7bc10388ccdd79b3d20463151a1f8e7a590a775b (diff)
downloadlinux-11f68686065a5634b09b374e988eb82c83a34d24.tar.bz2
Merge branch 'acpi-pnp'
* acpi-pnp: ACPI / resources: free memory on error in add_region_before()
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/resource.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/acpi/resource.c b/drivers/acpi/resource.c
index fcb7807ea8b7..10561ce16ed1 100644
--- 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;