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
parentMerge tag 'pm+acpi-4.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/... (diff)
parentACPI / resources: free memory on error in add_region_before() (diff)
downloadlinux-11f68686065a5634b09b374e988eb82c83a34d24.tar.xz
linux-11f68686065a5634b09b374e988eb82c83a34d24.zip
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;