From 3c0fc0710185e618a661528eed2183102e25c2f8 Mon Sep 17 00:00:00 2001 From: Liu ShuoX Date: Tue, 16 Jul 2013 16:23:44 +0800 Subject: [PATCH] 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 Signed-off-by: Rafael J. Wysocki --- drivers/pnp/pnpacpi/rsparser.c | 2 +- drivers/pnp/resource.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/pnp/pnpacpi/rsparser.c b/drivers/pnp/pnpacpi/rsparser.c index 9847ab163829..167f3d00c916 100644 --- a/drivers/pnp/pnpacpi/rsparser.c +++ b/drivers/pnp/pnpacpi/rsparser.c @@ -180,7 +180,7 @@ static acpi_status pnpacpi_allocated_resource(struct acpi_resource *res, struct pnp_dev *dev = data; struct acpi_resource_dma *dma; struct acpi_resource_vendor_typed *vendor_typed; - struct resource r; + struct resource r = {0}; int i, flags; if (acpi_dev_resource_memory(res, &r) diff --git a/drivers/pnp/resource.c b/drivers/pnp/resource.c index 3e6db1c1dc29..d95e101ffb43 100644 --- a/drivers/pnp/resource.c +++ b/drivers/pnp/resource.c @@ -515,6 +515,7 @@ struct pnp_resource *pnp_add_resource(struct pnp_dev *dev, } pnp_res->res = *res; + pnp_res->res.name = dev->name; dev_dbg(&dev->dev, "%pR\n", res); return pnp_res; }