Skip to content

Commit 0dac2f7

Browse files
qa-majeedrafaeljw
authored andcommitted
ACPI: SBSHC: Use strscpy() instead of strcpy()
Replace strcpy() with strscpy() in the ACPI SBSHC driver. strcpy() has been deprecated because it is generally unsafe, so it is better to eliminate it from the kernel source. Link: KSPP#88 Signed-off-by: Muhammad Qasim Abdul Majeed <qasim.majeed20@gmail.com> Link: https://patch.msgid.link/20240915183822.34588-8-qasim.majeed20@gmail.com [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent c4ff125 commit 0dac2f7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/acpi/sbshc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,8 +257,8 @@ static int acpi_smbus_hc_add(struct acpi_device *device)
257257
return -EIO;
258258
}
259259

260-
strcpy(acpi_device_name(device), ACPI_SMB_HC_DEVICE_NAME);
261-
strcpy(acpi_device_class(device), ACPI_SMB_HC_CLASS);
260+
strscpy(acpi_device_name(device), ACPI_SMB_HC_DEVICE_NAME);
261+
strscpy(acpi_device_class(device), ACPI_SMB_HC_CLASS);
262262

263263
hc = kzalloc(sizeof(struct acpi_smb_hc), GFP_KERNEL);
264264
if (!hc)

0 commit comments

Comments
 (0)