Skip to content

Commit b483d3b

Browse files
committed
Merge branch 'pnp'
Merge a PNP change for 6.6-rc1: - Fix string truncation warning in pnpacpi_add_device() (Sunil V L). * pnp: PNP: ACPI: Fix string truncation warning
2 parents 56db6a8 + 99c31bf commit b483d3b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/pnp/pnpacpi/core.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,9 @@ static int __init pnpacpi_add_device(struct acpi_device *device)
254254
else
255255
strncpy(dev->name, acpi_device_bid(device), sizeof(dev->name));
256256

257+
/* Handle possible string truncation */
258+
dev->name[sizeof(dev->name) - 1] = '\0';
259+
257260
if (dev->active)
258261
pnpacpi_parse_allocated_resource(dev);
259262

0 commit comments

Comments
 (0)