aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/ina3221.c
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2020-01-16 10:44:17 -0800
committerGuenter Roeck <linux@roeck-us.net>2020-01-17 07:57:16 -0800
commit3bf8bdcf3bada771eb12b57f2a30caee69e8ab8d (patch)
treef14e6cb79fb5b97a5a0f88d247e03ed9f4c1a496 /drivers/hwmon/ina3221.c
parenthwmon: (adt7475) Make volt2reg return same reg as reg2volt input (diff)
downloadlinux-dev-3bf8bdcf3bada771eb12b57f2a30caee69e8ab8d.tar.xz
linux-dev-3bf8bdcf3bada771eb12b57f2a30caee69e8ab8d.zip
hwmon: (core) Do not use device managed functions for memory allocations
The hwmon core uses device managed functions, tied to the hwmon parent device, for various internal memory allocations. This is problematic since hwmon device lifetime does not necessarily match its parent's device lifetime. If there is a mismatch, memory leaks will accumulate until the parent device is released. Fix the problem by managing all memory allocations internally. The only exception is memory allocation for thermal device registration, which can be tied to the hwmon device, along with thermal device registration itself. Fixes: d560168b5d0f ("hwmon: (core) New hwmon registration API") Cc: stable@vger.kernel.org # v4.14.x: 47c332deb8e8: hwmon: Deal with errors from the thermal subsystem Cc: stable@vger.kernel.org # v4.14.x: 74e3512731bd: hwmon: (core) Fix double-free in __hwmon_device_register() Cc: stable@vger.kernel.org # v4.9.x: 3a412d5e4a1c: hwmon: (core) Simplify sysfs attribute name allocation Cc: stable@vger.kernel.org # v4.9.x: 47c332deb8e8: hwmon: Deal with errors from the thermal subsystem Cc: stable@vger.kernel.org # v4.9.x: 74e3512731bd: hwmon: (core) Fix double-free in __hwmon_device_register() Cc: stable@vger.kernel.org # v4.9+ Cc: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon/ina3221.c')
0 files changed, 0 insertions, 0 deletions