Commit 03d49073 authored by Heiko Carstens's avatar Heiko Carstens
Browse files

s390/hmcdrv: use strscpy() instead of strlcpy()



Given that strlcpy() is deprecated use strscpy() instead.

Signed-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
parent 6bb361d5
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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;
	}
+3 −3
Original line number Diff line number Diff line
@@ -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;
	}