From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: "Miguel García" <miguelgarciaroman8@gmail.com>,
"Andy Shevchenko" <andriy.shevchenko@linux.intel.com>
Cc: platform-driver-x86@vger.kernel.org,
LKML <linux-kernel@vger.kernel.org>,
yu.c.chen@intel.com, hansg@kernel.org, luzmaximilian@gmail.com,
skhan@linuxfoundation.org
Subject: Re: [PATCH] platform/x86: surfacepro3_button: replace deprecated strcpy() with strscpy()
Date: Sun, 27 Jul 2025 23:32:18 +0300 (EEST) [thread overview]
Message-ID: <77116abd-289e-efc6-c358-e4a1a1fc0131@linux.intel.com> (raw)
In-Reply-To: <20250724074539.37650-1-miguelgarciaroman8@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 985 bytes --]
On Thu, 24 Jul 2025, Miguel García wrote:
> strcpy() is deprecated for NUL-terminated strings. Replace it with
> strscpy() to guarantee NUL-termination. 'name' is a fixed-size local
> buffer.
>
> Signed-off-by: Miguel García <miguelgarciaroman8@gmail.com>
> ---
> drivers/platform/surface/surfacepro3_button.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/platform/surface/surfacepro3_button.c b/drivers/platform/surface/surfacepro3_button.c
> index 2755601f979c..9616548283a1 100644
> --- a/drivers/platform/surface/surfacepro3_button.c
> +++ b/drivers/platform/surface/surfacepro3_button.c
> @@ -211,7 +211,7 @@ static int surface_button_add(struct acpi_device *device)
> }
>
> name = acpi_device_name(device);
> - strcpy(name, SURFACE_BUTTON_DEVICE_NAME);
> + strscpy(name, SURFACE_BUTTON_DEVICE_NAME, sizeof(name));
strscpy() should nowadays support 2 args variant through clever macro
trickery.
--
i.
next prev parent reply other threads:[~2025-07-27 20:32 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-24 7:45 Miguel García
2025-07-27 20:32 ` Ilpo Järvinen [this message]
2025-07-28 1:47 ` Chen, Yu C
2025-07-28 5:30 ` Krzysztof Kozlowski
2025-07-28 19:49 ` [PATCH v2] " Miguel García
2025-07-28 20:11 ` [PATCH v3] " Miguel García
2025-08-19 10:00 ` Ilpo Järvinen
2025-07-29 7:38 ` [PATCH] " Miguel García Román
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=77116abd-289e-efc6-c358-e4a1a1fc0131@linux.intel.com \
--to=ilpo.jarvinen@linux.intel.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=hansg@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luzmaximilian@gmail.com \
--cc=miguelgarciaroman8@gmail.com \
--cc=platform-driver-x86@vger.kernel.org \
--cc=skhan@linuxfoundation.org \
--cc=yu.c.chen@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®