hwmon: (iio_hwmon) fix memory leak in name attribute
authorQuentin Schulz <quentin.schulz@free-electrons.com>
Tue, 26 Jul 2016 07:47:09 +0000 (09:47 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 7 Sep 2016 06:32:46 +0000 (08:32 +0200)
commitdde898fba89069f78be1d0174f5184dc939cce5f
tree288eb4e24f67561875b9d09ba281ac7ca66c7ffb
parenta2d9e40c8fdc8d206ebee3ec8066bf240a340c65
hwmon: (iio_hwmon) fix memory leak in name attribute

commit 5d17d3b4bbf3becb89fd48b74340a50a39736f6d upstream.

The "name" variable's memory is now freed when the device is destructed
thanks to devm function.

Signed-off-by: Quentin Schulz <quentin.schulz@free-electrons.com>
Reported-by: Guenter Roeck <linux@roeck-us.net>
Fixes: e0f8a24e0edfd ("staging:iio::hwmon interface client driver.")
Fixes: 61bb53bcbdd86 ("hwmon: (iio_hwmon) Add support for humidity sensors")
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hwmon/iio_hwmon.c