Patch "i2c: at91: Initialize dma_buf in at91_twi_xfer()" has been added to the 5.18-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: at91: Initialize dma_buf in at91_twi_xfer()

to the 5.18-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-at91-initialize-dma_buf-in-at91_twi_xfer.patch
and it can be found in the queue-5.18 subdirectory.

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



commit d47cea41fa4ea6bef84ba90c1d8dd8e801cd26dc
Author: Nathan Chancellor <nathan@xxxxxxxxxx>
Date:   Thu May 5 08:27:38 2022 -0700

    i2c: at91: Initialize dma_buf in at91_twi_xfer()
    
    [ Upstream commit 6977262c2eee111645668fe9e235ef2f5694abf7 ]
    
    Clang warns:
    
      drivers/i2c/busses/i2c-at91-master.c:707:6: warning: variable 'dma_buf' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
              if (dev->use_dma) {
                  ^~~~~~~~~~~~
      drivers/i2c/busses/i2c-at91-master.c:717:27: note: uninitialized use occurs here
              i2c_put_dma_safe_msg_buf(dma_buf, m_start, !ret);
                                       ^~~~~~~
    
    Initialize dma_buf to NULL, as i2c_put_dma_safe_msg_buf() is a no-op
    when the first argument is NULL, which will work for the !dev->use_dma
    case.
    
    Fixes: 03fbb903c8bf ("i2c: at91: use dma safe buffers")
    Link: https://github.com/ClangBuiltLinux/linux/issues/1629
    Signed-off-by: Nathan Chancellor <nathan@xxxxxxxxxx>
    Reviewed-by: Michael Walle <michael@xxxxxxxx>
    Signed-off-by: Wolfram Sang <wsa@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/i2c/busses/i2c-at91-master.c b/drivers/i2c/busses/i2c-at91-master.c
index 5eca3b3bb609..c0c35785a0dc 100644
--- a/drivers/i2c/busses/i2c-at91-master.c
+++ b/drivers/i2c/busses/i2c-at91-master.c
@@ -656,7 +656,7 @@ static int at91_twi_xfer(struct i2c_adapter *adap, struct i2c_msg *msg, int num)
 	unsigned int_addr_flag = 0;
 	struct i2c_msg *m_start = msg;
 	bool is_read;
-	u8 *dma_buf;
+	u8 *dma_buf = NULL;
 
 	dev_dbg(&adap->dev, "at91_xfer: processing %d messages:\n", num);
 



[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