mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Muhammad Qasim Abdul Majeed <qasim.majeed20@gmail.com>
To: rafael@kernel.org, lenb@kernel.org, linux-acpi@vger.kernel.org,
	linux-kernel@vger.kernel.org
Cc: Muhammad Qasim Abdul Majeed <qasim.majeed20@gmail.com>
Subject: [PATCH v2 3/6] ACPI: acpi_processor: Use strscpy instead of strcpy.
Date: Sun,  4 Aug 2024 17:33:10 +0500	[thread overview]
Message-ID: <20240804123313.16211-3-qasim.majeed20@gmail.com> (raw)
In-Reply-To: <20240804123313.16211-1-qasim.majeed20@gmail.com>

Replace strcpy() with strscpy() in the ACPI acpi_processor driver.
strcpy() has been deprecated because it is generally unsafe, so help to
eliminate it from the kernel source.

Link: https://github.com/KSPP/linux/issues/88

Signed-off-by: Muhammad Qasim Abdul Majeed <qasim.majeed20@gmail.com>
---
 drivers/acpi/acpi_processor.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/acpi/acpi_processor.c b/drivers/acpi/acpi_processor.c
index 7a0dd35d62c9..8a8826a2242d 100644
--- a/drivers/acpi/acpi_processor.c
+++ b/drivers/acpi/acpi_processor.c
@@ -394,8 +394,8 @@ static int acpi_processor_add(struct acpi_device *device,
 	}
 
 	pr->handle = device->handle;
-	strcpy(acpi_device_name(device), ACPI_PROCESSOR_DEVICE_NAME);
-	strcpy(acpi_device_class(device), ACPI_PROCESSOR_CLASS);
+	strscpy(acpi_device_name(device), ACPI_PROCESSOR_DEVICE_NAME);
+	strscpy(acpi_device_class(device), ACPI_PROCESSOR_CLASS);
 	device->driver_data = pr;
 
 	result = acpi_processor_get_info(device);
-- 
2.34.1


  parent reply	other threads:[~2024-08-04 12:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-04 12:33 [PATCH v2 1/6] ACPI: ac: Use strscpy() instead of strcpy() Muhammad Qasim Abdul Majeed
2024-08-04 12:33 ` [PATCH v2 2/6] ACPI: acpi_pad: Use strscpy instead of strcpy Muhammad Qasim Abdul Majeed
2024-08-04 12:33 ` Muhammad Qasim Abdul Majeed [this message]
2024-08-04 12:33 ` [PATCH v2 4/6] ACPI: battery : " Muhammad Qasim Abdul Majeed
2024-08-04 12:33 ` [PATCH v2 5/6] ACPI: button: " Muhammad Qasim Abdul Majeed
2024-08-26 17:19   ` Rafael J. Wysocki
2024-08-04 12:33 ` [PATCH v2 6/6] ACPI: bus: Define and use a macro for device and class name length Muhammad Qasim Abdul Majeed
2024-08-26 17:14 ` [PATCH v2 1/6] ACPI: ac: Use strscpy() instead of strcpy() Rafael J. Wysocki

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=20240804123313.16211-3-qasim.majeed20@gmail.com \
    --to=qasim.majeed20@gmail.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael@kernel.org \
    /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®