Patch "crypto: hisilicon/hpre - Fix a erroneous check after snprintf()" has been added to the 6.1-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: hisilicon/hpre - Fix a erroneous check after snprintf()

to the 6.1-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-hisilicon-hpre-fix-a-erroneous-check-after-sn.patch
and it can be found in the queue-6.1 subdirectory.

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



commit a9f1d8b23ae79d99398002b2d44d17ceff0933a0
Author: Christophe JAILLET <christophe.jaillet@xxxxxxxxxx>
Date:   Mon Sep 4 22:17:29 2023 +0200

    crypto: hisilicon/hpre - Fix a erroneous check after snprintf()
    
    [ Upstream commit c977950146720abff14e46d8c53f5638b06a9182 ]
    
    This error handling looks really strange.
    Check if the string has been truncated instead.
    
    Fixes: 02ab994635eb ("crypto: hisilicon - Fixed some tiny bugs of HPRE")
    Signed-off-by: Christophe JAILLET <christophe.jaillet@xxxxxxxxxx>
    Signed-off-by: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/crypto/hisilicon/hpre/hpre_main.c b/drivers/crypto/hisilicon/hpre/hpre_main.c
index baf1faec7046f..2a4418f781a3f 100644
--- a/drivers/crypto/hisilicon/hpre/hpre_main.c
+++ b/drivers/crypto/hisilicon/hpre/hpre_main.c
@@ -1031,7 +1031,7 @@ static int hpre_cluster_debugfs_init(struct hisi_qm *qm)
 
 	for (i = 0; i < clusters_num; i++) {
 		ret = snprintf(buf, HPRE_DBGFS_VAL_MAX_LEN, "cluster%d", i);
-		if (ret < 0)
+		if (ret >= HPRE_DBGFS_VAL_MAX_LEN)
 			return -EINVAL;
 		tmp_d = debugfs_create_dir(buf, qm->debug.debug_root);
 



[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