mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Johan Hovold <johan@kernel.org>
To: Chenyuan Yang <chenyuan0y@gmail.com>
Cc: vkoul@kernel.org, kishon@kernel.org, lumag@kernel.org,
	quic_kriskura@quicinc.com, manivannan.sadhasivam@linaro.org,
	konrad.dybcio@oss.qualcomm.com, quic_varada@quicinc.com,
	quic_kbajaj@quicinc.com, johan+linaro@kernel.org,
	linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	Krzysztof Kozlowski <krzk@kernel.org>
Subject: Re: [PATCH v2] phy: qcom-qmp-usb: Fix an NULL vs IS_ERR() bug
Date: Mon, 14 Apr 2025 14:58:36 +0200	[thread overview]
Message-ID: <Z_0GfAFufdAiYE_j@hovoldconsulting.com> (raw)
In-Reply-To: <20250414125050.2118619-1-chenyuan0y@gmail.com>

On Mon, Apr 14, 2025 at 07:50:50AM -0500, Chenyuan Yang wrote:
> The qmp_usb_iomap() helper function currently returns the raw result of
> devm_ioremap() for non-exclusive mappings. Since devm_ioremap() may return
> a NULL pointer and the caller only checks error pointers with IS_ERR(),
> NULL could bypass the check and lead to an invalid dereference.
> 
> Fix the issue by checking if devm_ioremap() returns NULL. When it does,
> qmp_usb_iomap() now returns an error pointer via IOMEM_ERR_PTR(-ENOMEM),
> ensuring safe and consistent error handling.
> 
> Signed-off-by: Chenyuan Yang <chenyuan0y@gmail.com>
> Fixes: a5d6b1ac56cb ("phy: qcom-qmp-usb: fix memleak on probe deferral")
> CC: Johan Hovold <johan@kernel.org>
> CC: Krzysztof Kozlowski <krzk@kernel.org>
> ---

Thanks for the update, looks good.

Next time, remember to include a short changelog here after the --- line
(so that it does not get included in the commit message when the patch
is applied).

Reviewed-by: Johan Hovold <johan+linaro@kernel.org>

Johan

  reply	other threads:[~2025-04-14 12:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-14 12:50 Chenyuan Yang
2025-04-14 12:58 ` Johan Hovold [this message]
2025-04-15 10:26 ` Dmitry Baryshkov
2025-05-14 11:37 ` Vinod Koul

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=Z_0GfAFufdAiYE_j@hovoldconsulting.com \
    --to=johan@kernel.org \
    --cc=chenyuan0y@gmail.com \
    --cc=johan+linaro@kernel.org \
    --cc=kishon@kernel.org \
    --cc=konrad.dybcio@oss.qualcomm.com \
    --cc=krzk@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-phy@lists.infradead.org \
    --cc=lumag@kernel.org \
    --cc=manivannan.sadhasivam@linaro.org \
    --cc=quic_kbajaj@quicinc.com \
    --cc=quic_kriskura@quicinc.com \
    --cc=quic_varada@quicinc.com \
    --cc=vkoul@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

all inboxes | Powered by JetHome®