From: Joerg Roedel <joro@8bytes.org>
To: ethan zhao <ethan.zhao@oracle.com>
Cc: dwmw2@infradead.org, yinghai@kernel.org, bhelgaas@google.com,
jiang.liu@linux.intel.com, iommu@lists.linux-foundation.org,
linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH Trivial] intel-iommu: check return value of device_to_iommu() before using it
Date: Thu, 9 Jan 2014 13:01:35 +0100 [thread overview]
Message-ID: <20140109120135.GJ29041@8bytes.org> (raw)
In-Reply-To: <52CE0252.4090106@oracle.com>
On Thu, Jan 09, 2014 at 09:58:42AM +0800, ethan zhao wrote:
> drivers/iommu/intel-iommu.c | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
> index 40203ad..5b4531a 100644
> --- a/drivers/iommu/intel-iommu.c
> +++ b/drivers/iommu/intel-iommu.c
> @@ -1105,6 +1105,8 @@ static struct device_domain_info
> *iommu_support_dev_iotlb(
> struct device_domain_info *info;
> struct intel_iommu *iommu = device_to_iommu(segment, bus, devfn);
>
> + if (!iommu)
> + return NULL;
> if (!ecap_dev_iotlb_support(iommu->ecap))
> return NULL;
This call can not fail, iommu_support_dev_iotlb() is only called from
domain_context_mapping_one() which does the iommu==NULL check on its
own before the call.
Joerg
next prev parent reply other threads:[~2014-01-09 12:01 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-09 1:58 [PATCH Trivial] intel-iommu: check return value of device_to_iommu() before using it ethan zhao
2014-01-09 12:01 ` Joerg Roedel [this message]
2014-01-10 2:16 ` Ethan Zhao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140109120135.GJ29041@8bytes.org \
--to=joro@8bytes.org \
--cc=bhelgaas@google.com \
--cc=dwmw2@infradead.org \
--cc=ethan.zhao@oracle.com \
--cc=iommu@lists.linux-foundation.org \
--cc=jiang.liu@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=yinghai@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox