summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomasz Unger <tomasz.unger@yahoo.pl>2026-03-01 16:56:33 +0300
committerJakub Kicinski <kuba@kernel.org>2026-03-04 04:12:53 +0300
commit66e807f96f4e895283ac27ebd0e2513d7c8da557 (patch)
treed61f7cd87224c07058951f0562af5aced903954f
parente63f5918adb8efa7d9609585318db773ac7cd241 (diff)
downloadlinux-66e807f96f4e895283ac27ebd0e2513d7c8da557.tar.xz
NFC: nxp-nci: Replace strcpy() with strscpy()
Replace strcpy() with strscpy() which limits the copy to the size of the destination buffer. Since fw_info->name is an array, the two-argument variant of strscpy() is used - the compiler deduces the buffer size automatically. This is a defensive cleanup replacing the deprecated strcpy() with the preferred strscpy(). Signed-off-by: Tomasz Unger <tomasz.unger@yahoo.pl> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/20260301135633.214497-1-tomasz.unger@yahoo.pl Signed-off-by: Jakub Kicinski <kuba@kernel.org>
-rw-r--r--drivers/nfc/nxp-nci/firmware.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/nfc/nxp-nci/firmware.c b/drivers/nfc/nxp-nci/firmware.c
index 381b5bb75477..a9533977aff8 100644
--- a/drivers/nfc/nxp-nci/firmware.c
+++ b/drivers/nfc/nxp-nci/firmware.c
@@ -211,7 +211,7 @@ int nxp_nci_fw_download(struct nci_dev *ndev, const char *firmware_name)
goto fw_download_exit;
}
- strcpy(fw_info->name, firmware_name);
+ strscpy(fw_info->name, firmware_name);
r = request_firmware(&fw_info->fw, firmware_name,
ndev->nfc_dev->dev.parent);