ACPI / EC: Free saved_ec on error exit path
authorColin Ian King <colin.king@canonical.com>
Wed, 2 Jul 2014 23:35:09 +0000 (00:35 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 7 Jul 2014 11:20:30 +0000 (13:20 +0200)
commited4b197ddd4d7aa6623e7777ea326c67c3a6b8ed
treed714f53edff0112ae0e7f9a81cec30d502024aa6
parentdd43de20f540179863d9d7c3188b6a6cfde9a731
ACPI / EC: Free saved_ec on error exit path

Smatch detected two memory leaks on saved_ec:

drivers/acpi/ec.c:1070 acpi_ec_ecdt_probe() warn: possible
  memory leak of 'saved_ec'
drivers/acpi/ec.c:1109 acpi_ec_ecdt_probe() warn: possible
  memory leak of 'saved_ec'

Free saved_ec on these two error exit paths to stop the memory
leak.  Note that saved_ec maybe null, but kfree on null is allowed.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Lan Tianyu <tianyu.lan@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/ec.c