提交 6ec5e8b5 编写于 作者: Z Zhangfei Gao 提交者: Herbert Xu

crypto: hisilicon - fix strncpy warning with strscpy

Use strscpy to fix the warning
warning: 'strncpy' specified bound 64 equals destination size
Reported-by: Nkernel test robot <lkp@intel.com>
Signed-off-by: NZhangfei Gao <zhangfei.gao@linaro.org>
Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
上级 a05b1c15
......@@ -2170,8 +2170,12 @@ static int qm_alloc_uacce(struct hisi_qm *qm)
.flags = UACCE_DEV_SVA,
.ops = &uacce_qm_ops,
};
int ret;
strncpy(interface.name, pdev->driver->name, sizeof(interface.name));
ret = strscpy(interface.name, pdev->driver->name,
sizeof(interface.name));
if (ret < 0)
return -ENAMETOOLONG;
uacce = uacce_alloc(&pdev->dev, &interface);
if (IS_ERR(uacce))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册