Skip to content

Commit

Permalink
Merge branch 'pnp'
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Rafael J. Wysocki committed Aug 25, 2023
2 parents 56db6a8 + 99c31bf commit b483d3b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/pnp/pnpacpi/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,9 @@ static int __init pnpacpi_add_device(struct acpi_device *device)
else
strncpy(dev->name, acpi_device_bid(device), sizeof(dev->name));

/* Handle possible string truncation */
dev->name[sizeof(dev->name) - 1] = '\0';

if (dev->active)
pnpacpi_parse_allocated_resource(dev);

Expand Down

0 comments on commit b483d3b

Please sign in to comment.