Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1431381 > unrolled thread

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

Started byNicolas Iooss <nicolas.iooss_linux@m4x.org>
First post2016-06-26 10:40 +0200
Last post2016-06-27 13:30 +0200
Articles 3 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 1/1] iommu/amd: initialize devid variable before using it Nicolas Iooss <nicolas.iooss_linux@m4x.org> - 2016-06-26 10:40 +0200
    Re: [PATCH 1/1] iommu/amd: initialize devid variable before using it Wan ZongShun <mcuos.com@gmail.com> - 2016-06-27 04:20 +0200
    Re: [PATCH 1/1] iommu/amd: initialize devid variable before using it Joerg Roedel <joro@8bytes.org> - 2016-06-27 13:30 +0200

#1431381 — [PATCH 1/1] iommu/amd: initialize devid variable before using it

FromNicolas Iooss <nicolas.iooss_linux@m4x.org>
Date2016-06-26 10:40 +0200
Subject[PATCH 1/1] iommu/amd: initialize devid variable before using it
Message-ID<rOdLH-pe-1@gated-at.bofh.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.

Signed-off-by: Nicolas Iooss <nicolas.iooss_linux@m4x.org>
---
 drivers/iommu/amd_iommu_init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iommu/amd_iommu_init.c b/drivers/iommu/amd_iommu_init.c
index 9e0034196e10..d091defc3426 100644
--- a/drivers/iommu/amd_iommu_init.c
+++ b/drivers/iommu/amd_iommu_init.c
@@ -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);
-- 
2.9.0

[toc] | [next] | [standalone]


#1431673

FromWan ZongShun <mcuos.com@gmail.com>
Date2016-06-27 04:20 +0200
Message-ID<rOujv-2A6-3@gated-at.bofh.it>
In reply to#1431381
2016-06-26 16:33 GMT+08:00 Nicolas Iooss <nicolas.iooss_linux@m4x.org>:
> 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.
>
> Signed-off-by: Nicolas Iooss <nicolas.iooss_linux@m4x.org>
> ---
>  drivers/iommu/amd_iommu_init.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iommu/amd_iommu_init.c b/drivers/iommu/amd_iommu_init.c
> index 9e0034196e10..d091defc3426 100644
> --- a/drivers/iommu/amd_iommu_init.c
> +++ b/drivers/iommu/amd_iommu_init.c
> @@ -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;
>

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

>                         ret = add_acpi_hid_device(hid, uid, &devid, false);
> --
> 2.9.0
>



-- 
---
Vincent Wan(Zongshun)
www.mcuos.com

[toc] | [prev] | [next] | [standalone]


#1431957

FromJoerg Roedel <joro@8bytes.org>
Date2016-06-27 13:30 +0200
Message-ID<rOCTN-809-43@gated-at.bofh.it>
In reply to#1431381
On Sun, Jun 26, 2016 at 10:33:29AM +0200, Nicolas Iooss wrote:
> 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.
> 
> Signed-off-by: Nicolas Iooss <nicolas.iooss_linux@m4x.org>
> ---
>  drivers/iommu/amd_iommu_init.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web