Patch "i2c: xiic: xiic_xfer(): Fix runtime PM leak on error path" has been added to the 6.2-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: xiic: xiic_xfer(): Fix runtime PM leak on error path

to the 6.2-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-xiic-xiic_xfer-fix-runtime-pm-leak-on-error-path.patch
and it can be found in the queue-6.2 subdirectory.

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



commit 16d74c6d31b43c82f9a4a725b92750286578dce8
Author: Lars-Peter Clausen <lars@xxxxxxxxxx>
Date:   Thu Apr 13 19:10:22 2023 -0700

    i2c: xiic: xiic_xfer(): Fix runtime PM leak on error path
    
    [ Upstream commit d663d93bb47e7ab45602b227701022d8aa16040a ]
    
    The xiic_xfer() function gets a runtime PM reference when the function is
    entered. This reference is released when the function is exited. There is
    currently one error path where the function exits directly, which leads to
    a leak of the runtime PM reference.
    
    Make sure that this error path also releases the runtime PM reference.
    
    Fixes: fdacc3c7405d ("i2c: xiic: Switch from waitqueue to completion")
    Signed-off-by: Lars-Peter Clausen <lars@xxxxxxxxxx>
    Reviewed-by: Michal Simek <michal.simek@xxxxxxx>
    Signed-off-by: Wolfram Sang <wsa@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c
index bee5a2ef1f229..2bf3713b1969d 100644
--- a/drivers/i2c/busses/i2c-xiic.c
+++ b/drivers/i2c/busses/i2c-xiic.c
@@ -704,7 +704,7 @@ static int xiic_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
 	err = xiic_start_xfer(i2c, msgs, num);
 	if (err < 0) {
 		dev_err(adap->dev.parent, "Error xiic_start_xfer\n");
-		return err;
+		goto out;
 	}
 
 	err = wait_for_completion_timeout(&i2c->completion, XIIC_XFER_TIMEOUT);
@@ -722,6 +722,8 @@ static int xiic_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
 		err = (i2c->state == STATE_DONE) ? num : -EIO;
 	}
 	mutex_unlock(&i2c->lock);
+
+out:
 	pm_runtime_mark_last_busy(i2c->dev);
 	pm_runtime_put_autosuspend(i2c->dev);
 	return err;



[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