Patch "hwmon: (w83627ehf) Fix a resource leak in probe" has been added to the 5.9-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    hwmon: (w83627ehf) Fix a resource leak in probe

to the 5.9-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     hwmon-w83627ehf-fix-a-resource-leak-in-probe.patch
and it can be found in the queue-5.9 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 7151cb55edc0b53ea61347c49f99fb82a6dd3b69
Author: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
Date:   Mon Sep 21 15:52:12 2020 +0300

    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@xxxxxxxxxx>
    Reviewed-by: Dr. David Alan Gilbert <linux@xxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20200921125212.GA1128194@mwanda
    Signed-off-by: Guenter Roeck <linux@xxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/hwmon/w83627ehf.c b/drivers/hwmon/w83627ehf.c
index 5a5120121e507..3964ceab2817c 100644
--- a/drivers/hwmon/w83627ehf.c
+++ b/drivers/hwmon/w83627ehf.c
@@ -1951,8 +1951,12 @@ static int w83627ehf_probe(struct platform_device *pdev)
 							 data,
 							 &w83627ehf_chip_info,
 							 w83627ehf_groups);
+	if (IS_ERR(hwmon_dev)) {
+		err = PTR_ERR(hwmon_dev);
+		goto exit_release;
+	}
 
-	return PTR_ERR_OR_ZERO(hwmon_dev);
+	return 0;
 
 exit_release:
 	release_region(res->start, IOREGION_LENGTH);



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux