]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
hwmon: (w83627ehf) Fix a resource leak in probe
authorDan Carpenter <dan.carpenter@oracle.com>
Mon, 21 Sep 2020 12:52:12 +0000 (15:52 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 29 Oct 2020 09:07:22 +0000 (10:07 +0100)
commitabfdbdda990a5807700feb8e7527a212e568d615
treeea9238a4484c78bebf3caad7c8d6eb30e661c263
parent20d16af9c0fbae2722da7e83356823f2d1f0a75e
hwmon: (w83627ehf) Fix a resource leak in probe

[ Upstream commit 18360b33a071e5883250fd1e04bfdeff8c3887a3 ]

Smatch has a new check for resource leaks which found a bug in probe:

    drivers/hwmon/w83627ehf.c:2417 w83627ehf_probe()
    warn: 'res->start' not released on lines: 2412.

We need to clean up if devm_hwmon_device_register_with_info() fails.

Fixes: 266cd5835947 ("hwmon: (w83627ehf) convert to with_info interface")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Dr. David Alan Gilbert <linux@treblig.org>
Link: https://lore.kernel.org/r/20200921125212.GA1128194@mwanda
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/hwmon/w83627ehf.c