Skip to contentSkip to conversation

iommu/amd: Signedness bug in acpihid_device_group()

PATCH Applied Dan Carpenter 3 participants 3 messages Apr 11, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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')
drivers/iommu/amd_iommu.c +1 -1
index c430c10..12f7779 100644
@@ -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)
#1 lore raw
Quoted 20 lines

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')

drivers/iommu/amd_iommu.c +0 -0
index c430c10..12f7779 100644
@@ -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) {

drivers/iommu/amd_iommu.c static struct iommu_dev_data *get_dev_data(struct device *dev) · line 286

Quoted 3 lines
drivers/iommu/amd_iommu.c +1 -1
 	struct acpihid_map_entry *p, *entry = NULL;
-	u16 devid;
+	int devid;

Sure, thanks for your patch.

Wan Zongshun.

Quoted 3 lines
drivers/iommu/amd_iommu.c +0 -0
 	devid = get_acpihid_device_id(dev, &entry);
 	if (devid < 0)