Skip to content

Commit 3c0fc07

Browse files
Liu ShuoXrafaeljw
authored andcommitted
PNP / ACPI: avoid garbage in resource name
Set temporary variable as 0 to avoid garbage string output from /proc/iomem after register resources and reset to PNP dev name later. Signed-off-by: Liu ShuoX <shuox.liu@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent d19f503 commit 3c0fc07

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

‎drivers/pnp/pnpacpi/rsparser.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ static acpi_status pnpacpi_allocated_resource(struct acpi_resource *res,
180180
struct pnp_dev *dev = data;
181181
struct acpi_resource_dma *dma;
182182
struct acpi_resource_vendor_typed *vendor_typed;
183-
struct resource r;
183+
struct resource r = {0};
184184
int i, flags;
185185

186186
if (acpi_dev_resource_memory(res, &r)

‎drivers/pnp/resource.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,7 @@ struct pnp_resource *pnp_add_resource(struct pnp_dev *dev,
515515
}
516516

517517
pnp_res->res = *res;
518+
pnp_res->res.name = dev->name;
518519
dev_dbg(&dev->dev, "%pR\n", res);
519520
return pnp_res;
520521
}

0 commit comments

Comments
 (0)