提交 59203379 编写于 作者: N Nicholas Krause 提交者: Joerg Roedel

iommu/vt-d: Check the return value of iommu_device_create()

This adds the proper check to alloc_iommu to make sure that
the call to iommu_device_create has completed successfully
and if not return the error code to the caller after freeing
up resources allocated previously.
Signed-off-by: NNicholas Krause <xerofoify@gmail.com>
Signed-off-by: NJoerg Roedel <jroedel@suse.de>
上级 16830985
......@@ -1070,6 +1070,12 @@ static int alloc_iommu(struct dmar_drhd_unit *drhd)
intel_iommu_groups,
"%s", iommu->name);
if (IS_ERR(iommu->iommu_dev)) {
drhd->iommu = NULL;
err = PTR_ERR(iommu->iommu_dev);
goto err_unmap;
}
return 0;
err_unmap:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册