2016-04-11 07:15:24

by Dan Carpenter

[permalink] [raw]
Subject: [patch] iommu/amd: Signedness bug in acpihid_device_group()

"devid" needs to be signed for the error handling to work.

Fixes:b097d11a0fa3f ('iommu/amd: Manage iommu_group for ACPI HID devices')
Signed-off-by: Dan Carpenter <[email protected]>

diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
index c430c10..12f7779 100644
--- a/drivers/iommu/amd_iommu.c
+++ b/drivers/iommu/amd_iommu.c
@@ -283,7 +283,7 @@ static struct iommu_dev_data *get_dev_data(struct device *dev)
static struct iommu_group *acpihid_device_group(struct device *dev)
{
struct acpihid_map_entry *p, *entry = NULL;
- u16 devid;
+ int devid;

devid = get_acpihid_device_id(dev, &entry);
if (devid < 0)


2016-04-11 07:23:00

by Wan Zongshun

[permalink] [raw]
Subject: RE: [patch] iommu/amd: Signedness bug in acpihid_device_group()

> From: Dan Carpenter [mailto:[email protected]]
> Sent: Monday, April 11, 2016 3:15 PM
> To: Joerg Roedel; Wan, Vincent
> Cc: [email protected]; [email protected]; kernel-
> [email protected]
> Subject: [patch] iommu/amd: Signedness bug in acpihid_device_group()
>
> "devid" needs to be signed for the error handling to work.
>
> Fixes:b097d11a0fa3f ('iommu/amd: Manage iommu_group for ACPI HID
> devices')
> Signed-off-by: Dan Carpenter <[email protected]>
>
> diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
> index c430c10..12f7779 100644
> --- a/drivers/iommu/amd_iommu.c
> +++ b/drivers/iommu/amd_iommu.c
> @@ -283,7 +283,7 @@ static struct iommu_dev_data *get_dev_data(struct
> device *dev) static struct iommu_group *acpihid_device_group(struct device
> *dev) {
> struct acpihid_map_entry *p, *entry = NULL;
> - u16 devid;
> + int devid;

Sure, thanks for your patch.

Wan Zongshun.

>
> devid = get_acpihid_device_id(dev, &entry);
> if (devid < 0)

2016-04-11 14:11:37

by Joerg Roedel

[permalink] [raw]
Subject: Re: [patch] iommu/amd: Signedness bug in acpihid_device_group()

On Mon, Apr 11, 2016 at 10:14:46AM +0300, Dan Carpenter wrote:
> "devid" needs to be signed for the error handling to work.
>
> Fixes:b097d11a0fa3f ('iommu/amd: Manage iommu_group for ACPI HID devices')
> Signed-off-by: Dan Carpenter <[email protected]>

Applied, thanks.