From: "Heiko Stübner" <heiko@sntech.de>
To: Detlev Casanova <detlev.casanova@collabora.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Nicolas Dufresne <nicolas.dufresne@collabora.com>,
Hans Verkuil <hverkuil@kernel.org>,
linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, Miaoqian Lin <linmq006@gmail.com>
Cc: linmq006@gmail.com
Subject: Re: [PATCH] media: rkvdec: Fix incorrect NULL check for iommu_paging_domain_alloc
Date: Tue, 05 Aug 2025 10:40:02 +0200 [thread overview]
Message-ID: <2196043.OBFZWjSADL@diego> (raw)
In-Reply-To: <20250805061833.3670085-1-linmq006@gmail.com>
Am Dienstag, 5. August 2025, 08:18:33 Mitteleuropäische Sommerzeit schrieb Miaoqian Lin:
> iommu_paging_domain_alloc returns error pointers on failure.
> Replace the NULL check with IS_ERR to correctly handle error cases
> and avoid invalid pointer dereference.
>
> Fixes: ff8c5622f9f7 ("media: rkvdec: Restore iommu addresses on errors")
> Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Going from the (static inline) function definition [0] to the
iommu_paging_domain_alloc_flags() function [1] it uses, the doc states
"Return [...] or an ERR pointer for failure."
So this is the correct fix,
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
[0] https://elixir.bootlin.com/linux/v6.16/source/include/linux/iommu.h#L858
[1] https://elixir.bootlin.com/linux/v6.16/source/drivers/iommu/iommu.c#L2046
next prev parent reply other threads:[~2025-08-05 8:40 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-05 6:18 [PATCH] media: rkvdec: Fix incorrect NULL check for iommu_paging_domain_alloc Miaoqian Lin
2025-08-05 8:40 ` Heiko Stübner [this message]
2025-08-05 12:05 ` Nicolas Dufresne
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=2196043.OBFZWjSADL@diego \
--to=heiko@sntech.de \
--cc=detlev.casanova@collabora.com \
--cc=hverkuil@kernel.org \
--cc=linmq006@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=mchehab@kernel.org \
--cc=nicolas.dufresne@collabora.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).