Patch "i2c: xlr: Fix a resource leak in the error handling path of 'xlr_i2c_probe()'" has been added to the 4.14-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

    i2c: xlr: Fix a resource leak in the error handling path of 'xlr_i2c_probe()'

to the 4.14-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:
     i2c-xlr-fix-a-resource-leak-in-the-error-handling-pa.patch
and it can be found in the queue-4.14 subdirectory.

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



commit f37ba09969b6413eb404aac8d1cd6d4b3b08b1c9
Author: Christophe JAILLET <christophe.jaillet@xxxxxxxxxx>
Date:   Thu Aug 19 22:48:08 2021 +0200

    i2c: xlr: Fix a resource leak in the error handling path of 'xlr_i2c_probe()'
    
    [ Upstream commit 7f98960c046ee1136e7096aee168eda03aef8a5d ]
    
    A successful 'clk_prepare()' call should be balanced by a corresponding
    'clk_unprepare()' call in the error handling path of the probe, as already
    done in the remove function.
    
    More specifically, 'clk_prepare_enable()' is used, but 'clk_disable()' is
    also already called. So just the unprepare step has still to be done.
    
    Update the error handling path accordingly.
    
    Fixes: 75d31c2372e4 ("i2c: xlr: add support for Sigma Designs controller variant")
    Signed-off-by: Christophe JAILLET <christophe.jaillet@xxxxxxxxxx>
    Signed-off-by: Wolfram Sang <wsa@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/i2c/busses/i2c-xlr.c b/drivers/i2c/busses/i2c-xlr.c
index 484bfa15d58ee..dc9e20941efd1 100644
--- a/drivers/i2c/busses/i2c-xlr.c
+++ b/drivers/i2c/busses/i2c-xlr.c
@@ -434,11 +434,15 @@ static int xlr_i2c_probe(struct platform_device *pdev)
 	i2c_set_adapdata(&priv->adap, priv);
 	ret = i2c_add_numbered_adapter(&priv->adap);
 	if (ret < 0)
-		return ret;
+		goto err_unprepare_clk;
 
 	platform_set_drvdata(pdev, priv);
 	dev_info(&priv->adap.dev, "Added I2C Bus.\n");
 	return 0;
+
+err_unprepare_clk:
+	clk_unprepare(clk);
+	return ret;
 }
 
 static int xlr_i2c_remove(struct platform_device *pdev)



[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