* [PATCH net-next v2] NFC: s3fwrn5: Replace strcpy() with strscpy() [not found] <20260301174950.226192-1-tomasz.unger.ref@yahoo.pl> @ 2026-03-01 17:49 ` tomasz.unger 2026-03-02 9:06 ` Krzysztof Kozlowski 2026-03-02 9:06 ` Krzysztof Kozlowski 0 siblings, 2 replies; 3+ messages in thread From: tomasz.unger @ 2026-03-01 17:49 UTC (permalink / raw) To: krzk; +Cc: netdev, linux-kernel, Tomasz Unger From: Tomasz Unger <tomasz.unger@yahoo.pl> Replace strcpy() with strscpy() which limits the copy to the size of the destination buffer. Since fw_info->fw_name is an array with a fixed, declared size, 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> --- Changes since v1: - Clarified commit message: fw_info->fw_name described as "an array with a fixed, declared size" as requested by Krzysztof Kozlowski <krzk@kernel.org> Testing: - checkpatch.pl: 0 errors, 0 warnings - make M=drivers/nfc/s3fwrn5/: compiled successfully, 0 errors, 0 warnings - Module loaded successfully in QEMU (x86_64) with buildroot: modprobe s3fwrn5 - no errors, confirmed via lsmod drivers/nfc/s3fwrn5/firmware.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/nfc/s3fwrn5/firmware.c b/drivers/nfc/s3fwrn5/firmware.c index 64d61b2a715a..9145deec7f6c 100644 --- a/drivers/nfc/s3fwrn5/firmware.c +++ b/drivers/nfc/s3fwrn5/firmware.c @@ -454,7 +454,7 @@ void s3fwrn5_fw_init(struct s3fwrn5_fw_info *fw_info, const char *fw_name) fw_info->parity = 0x00; fw_info->rsp = NULL; fw_info->fw.fw = NULL; - strcpy(fw_info->fw_name, fw_name); + strscpy(fw_info->fw_name, fw_name); init_completion(&fw_info->completion); } -- 2.53.0 ^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net-next v2] NFC: s3fwrn5: Replace strcpy() with strscpy() 2026-03-01 17:49 ` [PATCH net-next v2] NFC: s3fwrn5: Replace strcpy() with strscpy() tomasz.unger @ 2026-03-02 9:06 ` Krzysztof Kozlowski 2026-03-02 9:06 ` Krzysztof Kozlowski 1 sibling, 0 replies; 3+ messages in thread From: Krzysztof Kozlowski @ 2026-03-02 9:06 UTC (permalink / raw) To: tomasz.unger; +Cc: netdev, linux-kernel On 01/03/2026 18:49, tomasz.unger@yahoo.pl wrote: > From: Tomasz Unger <tomasz.unger@yahoo.pl> > > Replace strcpy() with strscpy() which limits the copy to the size of > the destination buffer. Since fw_info->fw_name is an array with a fixed, declared size, 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> > --- > Changes since v1: > - Clarified commit message: fw_info->fw_name described as > "an array with a fixed, declared size" as requested by > Krzysztof Kozlowski <krzk@kernel.org> And ignored the rest? <form letter> This is a friendly reminder during the review process. It looks like you received a tag and forgot to add it. If you do not know the process, here is a short explanation: Please add Acked-by/Reviewed-by/Tested-by tags when posting new versions of patchset, under or above your Signed-off-by tag, unless patch changed significantly (e.g. new properties added to the DT bindings). Tag is "received", when provided in a message replied to you on the mailing list. Tools like b4 can help here. However, there's no need to repost patches *only* to add the tags. The upstream maintainer will do that for tags received on the version they apply. Please read: https://elixir.bootlin.com/linux/v6.12-rc3/source/Documentation/process/submitting-patches.rst#L577 If a tag was not added on purpose, please state why and what changed. </form letter> Best regards, Krzysztof ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net-next v2] NFC: s3fwrn5: Replace strcpy() with strscpy() 2026-03-01 17:49 ` [PATCH net-next v2] NFC: s3fwrn5: Replace strcpy() with strscpy() tomasz.unger 2026-03-02 9:06 ` Krzysztof Kozlowski @ 2026-03-02 9:06 ` Krzysztof Kozlowski 1 sibling, 0 replies; 3+ messages in thread From: Krzysztof Kozlowski @ 2026-03-02 9:06 UTC (permalink / raw) To: tomasz.unger; +Cc: netdev, linux-kernel On 01/03/2026 18:49, tomasz.unger@yahoo.pl wrote: > From: Tomasz Unger <tomasz.unger@yahoo.pl> > > Replace strcpy() with strscpy() which limits the copy to the size of > the destination buffer. Since fw_info->fw_name is an array with a fixed, declared size, the Please wrap commit message according to Linux coding style / submission process (neither too early nor over the limit): https://elixir.bootlin.com/linux/v6.4-rc1/source/Documentation/process/submitting-patches.rst#L597 Best regards, Krzysztof ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-03-02 9:06 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20260301174950.226192-1-tomasz.unger.ref@yahoo.pl>
2026-03-01 17:49 ` [PATCH net-next v2] NFC: s3fwrn5: Replace strcpy() with strscpy() tomasz.unger
2026-03-02 9:06 ` Krzysztof Kozlowski
2026-03-02 9:06 ` Krzysztof Kozlowski
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox