Commit 57bd2c24 authored by Joerg Roedel's avatar Joerg Roedel

iommu/amd: Return -ENODEV in add_device when device is not handled by IOMMU

When check_device() fails on the device, it is not handled by the
IOMMU and amd_iommu_add_device() needs to return -ENODEV.
Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
Link: https://lore.kernel.org/r/20200429133712.31431-7-joro@8bytes.orgSigned-off-by: default avatarJoerg Roedel <jroedel@suse.de>
parent c0da9b9f
......@@ -2157,9 +2157,12 @@ static int amd_iommu_add_device(struct device *dev)
struct amd_iommu *iommu;
int ret, devid;
if (!check_device(dev) || get_dev_data(dev))
if (get_dev_data(dev))
return 0;
if (!check_device(dev))
return -ENODEV;
devid = get_device_id(dev);
if (devid < 0)
return devid;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment