Skip to content
Commit f5df5b27 authored by Robin Murphy's avatar Robin Murphy Committed by Bruce Ashfield
Browse files

iommu/qcom: Fix bogus detach logic

commit faf305c5

 upstream.

Currently, the implementation of qcom_iommu_domain_free() is guaranteed
to do one of two things: WARN() and leak everything, or dereference NULL
and crash. That alone is terrible, but in fact the whole idea of trying
to track the liveness of a domain via the qcom_domain->iommu pointer as
a sanity check is full of fundamentally flawed assumptions. Make things
robust and actually functional by not trying to be quite so clever.

Reported-by: default avatarBrian Masney <masneyb@onstation.org>
Tested-by: default avatarBrian Masney <masneyb@onstation.org>
Reported-by: default avatarNaresh Kamboju <naresh.kamboju@linaro.org>
Fixes: 0ae349a0

 ("iommu/qcom: Add qcom_iommu")
Signed-off-by: default avatarRobin Murphy <robin.murphy@arm.com>
Tested-by: default avatarStephan Gerhold <stephan@gerhold.net>
Cc: stable@vger.kernel.org # v4.14+
Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 537cb877
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment