summaryrefslogtreecommitdiffstats
path: root/drivers/iommu
diff options
context:
space:
mode:
authorJoerg Roedel <jroedel@suse.de>2017-06-16 16:09:57 +0200
committerJoerg Roedel <jroedel@suse.de>2017-06-22 12:54:20 +0200
commit151b09031a76ba6b6b83f94953074d6f10aa30b3 (patch)
treed659ea3eec114633725cb6987e0e7021d64783a9 /drivers/iommu
parent1b1e942e344d3d41de187c1275024e915cb15844 (diff)
downloadtalos-obmc-linux-151b09031a76ba6b6b83f94953074d6f10aa30b3.tar.gz
talos-obmc-linux-151b09031a76ba6b6b83f94953074d6f10aa30b3.zip
iommu/amd: Check for error states first in iommu_go_to_state()
Check if we are in an error state already before calling into state_next(). Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'drivers/iommu')
-rw-r--r--drivers/iommu/amd_iommu_init.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/iommu/amd_iommu_init.c b/drivers/iommu/amd_iommu_init.c
index df9ec85271f5..a6b81a05a0d1 100644
--- a/drivers/iommu/amd_iommu_init.c
+++ b/drivers/iommu/amd_iommu_init.c
@@ -2467,14 +2467,14 @@ static int __init state_next(void)
static int __init iommu_go_to_state(enum iommu_init_state state)
{
- int ret = 0;
+ int ret = -EINVAL;
while (init_state != state) {
- ret = state_next();
if (init_state == IOMMU_NOT_FOUND ||
init_state == IOMMU_INIT_ERROR ||
init_state == IOMMU_CMDLINE_DISABLED)
break;
+ ret = state_next();
}
return ret;
OpenPOWER on IntegriCloud