mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-10 05:39:42 -04:00
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: Joerg Roedel <jroedel@suse.de> Link: https://lore.kernel.org/r/20200429133712.31431-7-joro@8bytes.org Signed-off-by: Joerg Roedel <jroedel@suse.de>
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user