scsi: lpfc: Fix gcc -Wstringop-overread warning
This commit is contained in:
parent
aefe970785
commit
3f7db5fc02
|
|
@ -516,11 +516,8 @@ lpfc_nvme_info_show(struct device *dev, struct device_attribute *attr,
|
|||
"6314 Catching potential buffer "
|
||||
"overflow > PAGE_SIZE = %lu bytes\n",
|
||||
PAGE_SIZE);
|
||||
strlcpy(buf + PAGE_SIZE - 1 -
|
||||
strnlen(LPFC_NVME_INFO_MORE_STR, PAGE_SIZE - 1),
|
||||
LPFC_NVME_INFO_MORE_STR,
|
||||
strnlen(LPFC_NVME_INFO_MORE_STR, PAGE_SIZE - 1)
|
||||
+ 1);
|
||||
strscpy(buf + PAGE_SIZE - 1 - sizeof(LPFC_NVME_INFO_MORE_STR),
|
||||
LPFC_NVME_INFO_MORE_STR, sizeof(LPFC_NVME_INFO_MORE_STR) + 1);
|
||||
}
|
||||
|
||||
return len;
|
||||
|
|
|
|||
Loading…
Reference in New Issue