lkml.org 
[lkml]   [2020]   [Jun]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] crypto: hisilicon - fix strncpy warning with strlcpy
Date
Use strlcpy to fix the warning
warning: 'strncpy' specified bound 64 equals destination size
[-Wstringop-truncation]

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Zhangfei Gao <zhangfei.gao@linaro.org>
---
drivers/crypto/hisilicon/qm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/crypto/hisilicon/qm.c b/drivers/crypto/hisilicon/qm.c
index f795fb5..224f3e2 100644
--- a/drivers/crypto/hisilicon/qm.c
+++ b/drivers/crypto/hisilicon/qm.c
@@ -1574,7 +1574,7 @@ static int qm_alloc_uacce(struct hisi_qm *qm)
.ops = &uacce_qm_ops,
};

- strncpy(interface.name, pdev->driver->name, sizeof(interface.name));
+ strlcpy(interface.name, pdev->driver->name, sizeof(interface.name));

uacce = uacce_alloc(&pdev->dev, &interface);
if (IS_ERR(uacce))
--
2.7.4
\
 
 \ /
  Last update: 2020-06-04 05:32    [W:0.083 / U:0.632 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site