mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-04 04:02:26 +00:00
s390/hmcdrv: use strscpy() instead of strlcpy()
Given that strlcpy() is deprecated use strscpy() instead. Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
This commit is contained in:
parent
6bb361d5d8
commit
03d4907396
@ -159,8 +159,8 @@ ssize_t diag_ftp_cmd(const struct hmcdrv_ftp_cmdspec *ftp, size_t *fsize)
|
||||
goto out;
|
||||
}
|
||||
|
||||
len = strlcpy(ldfpl->fident, ftp->fname, sizeof(ldfpl->fident));
|
||||
if (len >= HMCDRV_FTP_FIDENT_MAX) {
|
||||
len = strscpy(ldfpl->fident, ftp->fname, sizeof(ldfpl->fident));
|
||||
if (len < 0) {
|
||||
len = -EINVAL;
|
||||
goto out_free;
|
||||
}
|
||||
|
@ -90,7 +90,7 @@ static int sclp_ftp_et7(const struct hmcdrv_ftp_cmdspec *ftp)
|
||||
struct completion completion;
|
||||
struct sclp_diag_sccb *sccb;
|
||||
struct sclp_req *req;
|
||||
size_t len;
|
||||
ssize_t len;
|
||||
int rc;
|
||||
|
||||
req = kzalloc(sizeof(*req), GFP_KERNEL);
|
||||
@ -117,9 +117,9 @@ static int sclp_ftp_et7(const struct hmcdrv_ftp_cmdspec *ftp)
|
||||
sccb->evbuf.mdd.ftp.length = ftp->len;
|
||||
sccb->evbuf.mdd.ftp.bufaddr = virt_to_phys(ftp->buf);
|
||||
|
||||
len = strlcpy(sccb->evbuf.mdd.ftp.fident, ftp->fname,
|
||||
len = strscpy(sccb->evbuf.mdd.ftp.fident, ftp->fname,
|
||||
HMCDRV_FTP_FIDENT_MAX);
|
||||
if (len >= HMCDRV_FTP_FIDENT_MAX) {
|
||||
if (len < 0) {
|
||||
rc = -EINVAL;
|
||||
goto out_free;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user