mirror of
https://github.com/torvalds/linux.git
synced 2024-11-29 07:31:29 +00:00
crypto: hisilicon - fix strncpy warning with strscpy
Use strscpy to fix the warning warning: 'strncpy' specified bound 64 equals destination size Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Zhangfei Gao <zhangfei.gao@linaro.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
parent
a05b1c150f
commit
6ec5e8b5e7
@ -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))
|
||||
|
Loading…
Reference in New Issue
Block a user