From: Abhinav Kumar <quic_abhinavk@quicinc.com>
To: Yang Yingliang <yangyingliang@huawei.com>,
<linux-kernel@vger.kernel.org>, <freedreno@lists.freedesktop.org>,
<dri-devel@lists.freedesktop.org>,
<linux-arm-msm@vger.kernel.org>
Cc: <jilaiw@codeaurora.org>
Subject: Re: [PATCH] drm/msm/hdmi: check return value after calling platform_get_resource_byname()
Date: Thu, 21 Apr 2022 20:35:14 -0700 [thread overview]
Message-ID: <e54e4abe-d0af-4a27-63c4-e0deb855c741@quicinc.com> (raw)
In-Reply-To: <20220422032227.2991553-1-yangyingliang@huawei.com>
On 4/21/2022 8:22 PM, Yang Yingliang wrote:
> It will cause null-ptr-deref if platform_get_resource_byname() returns NULL,
> we need check the return value.
>
> Fixes: c6a57a50ad56 ("drm/msm/hdmi: add hdmi hdcp support (V3)")
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
> ---
> drivers/gpu/drm/msm/hdmi/hdmi.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.c b/drivers/gpu/drm/msm/hdmi/hdmi.c
> index ec324352e862..07e2ad527af9 100644
> --- a/drivers/gpu/drm/msm/hdmi/hdmi.c
> +++ b/drivers/gpu/drm/msm/hdmi/hdmi.c
> @@ -142,6 +142,10 @@ static struct hdmi *msm_hdmi_init(struct platform_device *pdev)
> /* HDCP needs physical address of hdmi register */
> res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
> config->mmio_name);
> + if (!res) {
> + ret = -EINVAL;
> + goto fail;
> + }
> hdmi->mmio_phy_addr = res->start;
>
> hdmi->qfprom_mmio = msm_ioremap(pdev, config->qfprom_mmio_name);
next prev parent reply other threads:[~2022-04-22 3:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-22 3:22 Yang Yingliang
2022-04-22 3:35 ` Abhinav Kumar [this message]
2022-04-22 10:41 ` Dmitry Baryshkov
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=e54e4abe-d0af-4a27-63c4-e0deb855c741@quicinc.com \
--to=quic_abhinavk@quicinc.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=freedreno@lists.freedesktop.org \
--cc=jilaiw@codeaurora.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®