Skip to content
Snippets Groups Projects
Commit ec62b1ab authored by Baoquan He's avatar Baoquan He Committed by Joerg Roedel
Browse files

iommu/amd: Check if domain is NULL in get_domain() and return -EBUSY


In get_domain(), 'domain' could be NULL before it's passed to dma_ops_domain()
to dereference. And the current code calling get_domain() can't deal with the
returned 'domain' well if its value is NULL.

So before dma_ops_domain() calling, check if 'domain' is NULL, If yes just return
ERR_PTR(-EBUSY) directly.

Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Fixes: df3f7a6e ('iommu/amd: Use is_attach_deferred call-back')
Signed-off-by: default avatarBaoquan He <bhe@redhat.com>
Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
parent 2479c631
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment