Skip to contentSkip to conversation

iommu/amd: initialize devid variable before using it

PATCH Applied Nicolas Iooss 3 participants 3 messages Jun 26, 2016 – Jun 27, 2016 IOMMU

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iommu/amd: initialize devid variable before using it

Commit 2a0cb4e2d423 ("iommu/amd: Add new map for storing IVHD dev entry type HID") added a call to DUMP_printk in init_iommu_from_acpi() which used the value of devid before this variable was initialized.

---
 drivers/iommu/amd_iommu_init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iommu/amd_iommu_init.c +1 -1
index 9e0034196e10..d091defc3426 100644
@@ -1107,13 +1107,13 @@ static int __init init_iommu_from_acpi(struct amd_iommu *iommu,
 				break;
 			}
 
+			devid = e->devid;
 			DUMP_printk("  DEV_ACPI_HID(%s[%s])\t\tdevid: %02x:%02x.%x\n",
 				    hid, uid,
 				    PCI_BUS_NUM(devid),
 				    PCI_SLOT(devid),
 				    PCI_FUNC(devid));
 
-			devid  = e->devid;
 			flags = e->flags;
 
 			ret = add_acpi_hid_device(hid, uid, &devid, false);
Signature · 1 line
2.9.0
#1 lore raw

2016-06-26 16:33 GMT+08:00 Nicolas Iooss <[email protected]>:

Quoted 17 lines

Commit 2a0cb4e2d423 ("iommu/amd: Add new map for storing IVHD dev entry type HID") added a call to DUMP_printk in init_iommu_from_acpi() which used the value of devid before this variable was initialized.

---
 drivers/iommu/amd_iommu_init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iommu/amd_iommu_init.c +0 -0
index 9e0034196e10..d091defc3426 100644
@@ -1107,13 +1107,13 @@ static int __init init_iommu_from_acpi(struct amd_iommu *iommu,
                                break;
                        }
 

drivers/iommu/amd_iommu_init.c static int __init init_iommu_from_acpi(struct amd_iommu *iommu, · line 1118

Quoted 10 lines
drivers/iommu/amd_iommu_init.c +1 -1
+                       devid = e->devid;
                        DUMP_printk("  DEV_ACPI_HID(%s[%s])\t\tdevid: %02x:%02x.%x\n",
                                    hid, uid,
                                    PCI_BUS_NUM(devid),
                                    PCI_SLOT(devid),
                                    PCI_FUNC(devid));
 
-                       devid  = e->devid;
                        flags = e->flags;
 

Sure, thanks for your patch.
This is my fault.

Quoted 4 lines
drivers/iommu/amd_iommu_init.c +0 -1
                        ret = add_acpi_hid_device(hid, uid, &devid, false);
--

2.9.0

Signature · 3 lines
---
Vincent Wan(Zongshun)
www.mcuos.com
maintainer Applied
#2 lore raw
In reply to Nicolas Iooss
Quoted 8 lines · Nicolas Iooss

Commit 2a0cb4e2d423 ("iommu/amd: Add new map for storing IVHD dev entry type HID") added a call to DUMP_printk in init_iommu_from_acpi() which used the value of devid before this variable was initialized.

---
 drivers/iommu/amd_iommu_init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks.