]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit3b145fb4d1820c5347ffca44584b8ce8b8f8a675
tree0e41fa7e565d1cd248864ed5dcfdf3b6358e0fd5
parent43b0f1ad8278f213f1665751fe055e9c98d991d0
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: 3a3d77c8dcc6 ("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