Patch "crypto: stm32/crc32 - fix parsing list of devices" has been added to the 6.6-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

    crypto: stm32/crc32 - fix parsing list of devices

to the 6.6-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:
     crypto-stm32-crc32-fix-parsing-list-of-devices.patch
and it can be found in the queue-6.6 subdirectory.

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



commit 39d56c11130b91d8d273c18c39722a1f16531e3a
Author: Thomas Bourgoin <thomas.bourgoin@xxxxxxxxxxx>
Date:   Fri Dec 15 12:17:24 2023 +0100

    crypto: stm32/crc32 - fix parsing list of devices
    
    [ Upstream commit 0eaef675b94c746900dcea7f6c41b9a103ed5d53 ]
    
    smatch warnings:
    drivers/crypto/stm32/stm32-crc32.c:108 stm32_crc_get_next_crc() warn:
    can 'crc' even be NULL?
    
    Use list_first_entry_or_null instead of list_first_entry to retrieve
    the first device registered.
    The function list_first_entry always return a non NULL pointer even if
    the list is empty. Hence checking if the pointer returned is NULL does
    not tell if the list is empty or not.
    
    Reported-by: kernel test robot <lkp@xxxxxxxxx>
    Closes: https://lore.kernel.org/r/202311281111.ou2oUL2i-lkp@xxxxxxxxx/
    Reported-by: Dan Carpenter <error27@xxxxxxxxx>
    Closes: https://lore.kernel.org/r/202311281111.ou2oUL2i-lkp@xxxxxxxxx/
    Signed-off-by: Thomas Bourgoin <thomas.bourgoin@xxxxxxxxxxx>
    Signed-off-by: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/crypto/stm32/stm32-crc32.c b/drivers/crypto/stm32/stm32-crc32.c
index 90a920e7f664..c439be1650c8 100644
--- a/drivers/crypto/stm32/stm32-crc32.c
+++ b/drivers/crypto/stm32/stm32-crc32.c
@@ -104,7 +104,7 @@ static struct stm32_crc *stm32_crc_get_next_crc(void)
 	struct stm32_crc *crc;
 
 	spin_lock_bh(&crc_list.lock);
-	crc = list_first_entry(&crc_list.dev_list, struct stm32_crc, list);
+	crc = list_first_entry_or_null(&crc_list.dev_list, struct stm32_crc, list);
 	if (crc)
 		list_move_tail(&crc->list, &crc_list.dev_list);
 	spin_unlock_bh(&crc_list.lock);




[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