i2c: i801: Avoid memory leak in check_acpi_smo88xx_device()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Fri, 16 Aug 2019 13:17:05 +0000 (16:17 +0300)
committerWolfram Sang <wsa@the-dreams.de>
Thu, 29 Aug 2019 18:46:48 +0000 (20:46 +0200)
commit01641b266da33e2cc57b4ea1767ba3e24ce0846b
tree0e41fa7e565d1cd248864ed5dcfdf3b6358e0fd5
parent689f535843ac2633b395cfc494446326d03efab6
i2c: i801: Avoid memory leak in check_acpi_smo88xx_device()

check_acpi_smo88xx_device() utilizes acpi_get_object_info() which in its turn
allocates a buffer. User is responsible to clean allocated resources. The last
has been missed in the original code. Fix it here.

While here, replace !ACPI_SUCCESS() with ACPI_FAILURE().

Fixes: 19b07cb4a187 ("i2c: i801: Register optional lis3lv02d I2C device on Dell machines")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Pali Rohár <pali.rohar@gmail.com>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
drivers/i2c/busses/i2c-i801.c