All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joerg Roedel <joro@8bytes.org>
To: Yang Yingliang <yangyingliang@huawei.com>
Cc: iommu@lists.linux-foundation.org, will@kernel.org,
	linux-kernel@vger.kernel.org, alyssa@rosenzweig.io
Subject: Re: [PATCH] iommu/dart: check return value after calling platform_get_resource()
Date: Thu, 28 Apr 2022 11:39:03 +0200	[thread overview]
Message-ID: <Ympgt+2G8fXD1w5H@8bytes.org> (raw)
In-Reply-To: <20220425090826.2532165-1-yangyingliang@huawei.com>

On Mon, Apr 25, 2022 at 05:08:26PM +0800, Yang Yingliang wrote:
> It will cause null-ptr-deref in resource_size(), if platform_get_resource()
> returns NULL, move calling resource_size() after devm_ioremap_resource() that
> will check 'res' to avoid null-ptr-deref.
> And use devm_platform_get_and_ioremap_resource() to simplify code.
> 
> Fixes: 46d1fb072e76 ("iommu/dart: Add DART iommu driver")
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
> ---
>  drivers/iommu/apple-dart.c | 9 ++++-----
>  1 file changed, 4 insertions(+), 5 deletions(-)

Applied to iommu/fixes, thanks.
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

WARNING: multiple messages have this Message-ID (diff)
From: Joerg Roedel <joro@8bytes.org>
To: Yang Yingliang <yangyingliang@huawei.com>
Cc: linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org,
	will@kernel.org, alyssa@rosenzweig.io, sven@svenpeter.dev
Subject: Re: [PATCH] iommu/dart: check return value after calling platform_get_resource()
Date: Thu, 28 Apr 2022 11:39:03 +0200	[thread overview]
Message-ID: <Ympgt+2G8fXD1w5H@8bytes.org> (raw)
In-Reply-To: <20220425090826.2532165-1-yangyingliang@huawei.com>

On Mon, Apr 25, 2022 at 05:08:26PM +0800, Yang Yingliang wrote:
> It will cause null-ptr-deref in resource_size(), if platform_get_resource()
> returns NULL, move calling resource_size() after devm_ioremap_resource() that
> will check 'res' to avoid null-ptr-deref.
> And use devm_platform_get_and_ioremap_resource() to simplify code.
> 
> Fixes: 46d1fb072e76 ("iommu/dart: Add DART iommu driver")
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
> ---
>  drivers/iommu/apple-dart.c | 9 ++++-----
>  1 file changed, 4 insertions(+), 5 deletions(-)

Applied to iommu/fixes, thanks.

  parent reply	other threads:[~2022-04-28  9:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-25  9:08 [PATCH] iommu/dart: check return value after calling platform_get_resource() Yang Yingliang via iommu
2022-04-25  9:08 ` Yang Yingliang
2022-04-26 20:22 ` Sven Peter via iommu
2022-04-26 20:22   ` Sven Peter
2022-04-28  9:39 ` Joerg Roedel [this message]
2022-04-28  9:39   ` Joerg Roedel

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=Ympgt+2G8fXD1w5H@8bytes.org \
    --to=joro@8bytes.org \
    --cc=alyssa@rosenzweig.io \
    --cc=iommu@lists.linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=will@kernel.org \
    --cc=yangyingliang@huawei.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.