Skip to contentSkip to conversation

ACPI / amba: Fix resource name in /proc/iomem

PATCH Applied Liguang Zhang 2 participants 2 messages Jun 29, 2021 – Jun 30, 2021 ACPI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ACPI / amba: Fix resource name in /proc/iomem

In function amba_handler_attach(), dev->res.name is initialized by amba_device_alloc. But when address_found is false, dev->res.name is assigned to null value, which leads to wrong resource name display in /proc/iomem, "<BAD>" is seen for those resources.

---
 drivers/acpi/acpi_amba.c | 1 +
 1 file changed, 1 insertion(+)
drivers/acpi/acpi_amba.c +1 -0
index 49b781a9cd97..ab8a4e0191b1 100644
@@ -76,6 +76,7 @@ static int amba_handler_attach(struct acpi_device *adev,
 		case IORESOURCE_MEM:
 			if (!address_found) {
 				dev->res = *rentry->res;
+				dev->res.name = dev_name(&dev->dev);
 				address_found = true;
 			}
 			break;
Signature · 1 line
2.19.1.6.gb485710b
maintainer Applied
#1 lore raw
Quoted 16 lines · Liguang Zhang

In function amba_handler_attach(), dev->res.name is initialized by amba_device_alloc. But when address_found is false, dev->res.name is assigned to null value, which leads to wrong resource name display in /proc/iomem, "<BAD>" is seen for those resources.

---
 drivers/acpi/acpi_amba.c | 1 +
 1 file changed, 1 insertion(+)
drivers/acpi/acpi_amba.c +0 -0
index 49b781a9cd97..ab8a4e0191b1 100644

drivers/acpi/acpi_amba.c static int amba_handler_attach(struct acpi_device *adev,

Quoted 8 lines
drivers/acpi/acpi_amba.c +1 -1
@@ -76,6 +76,7 @@ static int amba_handler_attach(struct acpi_device *adev,
                case IORESOURCE_MEM:
                        if (!address_found) {
                                dev->res = *rentry->res;
+                               dev->res.name = dev_name(&dev->dev);
                                address_found = true;
                        }
                        break;
--

Applied as 5.14-rc1 material, thanks!