diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c index 4cd19f93ca157ae72ccc73ebe20d903dad8a8724..121c54f1c768106e5e38fbd33d1db16c03943217 100644 --- a/drivers/iommu/amd_iommu.c +++ b/drivers/iommu/amd_iommu.c @@ -310,6 +310,8 @@ static struct iommu_dev_data *find_dev_data(u16 devid) if (dev_data == NULL) { dev_data = alloc_dev_data(devid); + if (!dev_data) + return NULL; if (translation_pre_enabled(iommu)) dev_data->defer_attach = true;