From: Krzysztof Kozlowski <krzk@kernel.org>
To: Johan Hovold <johan@kernel.org>
Cc: Chenyuan Yang <chenyuan0y@gmail.com>,
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
Subject: Re: [PATCH] phy: qcom-qmp-usb: Fix an NULL vs IS_ERR() bug
Date: Mon, 14 Apr 2025 10:08:18 +0200 [thread overview]
Message-ID: <f3b77aa4-e7a4-475f-a633-48aab59fa9b1@kernel.org> (raw)
In-Reply-To: <Z_y73a5IDO66AzY1@hovoldconsulting.com>
On 14/04/2025 09:40, Johan Hovold wrote:
> On Mon, Apr 14, 2025 at 09:30:19AM +0200, Krzysztof Kozlowski wrote:
>> On 13/04/2025 23:25, Chenyuan Yang wrote:
>>> In qmp_usb_iomap(), one branch returns the result of devm_ioremap(), which
>>> can be NULL. Since IS_ERR() does not catch a NULL pointer,
>>
>> No, that's not true. NAK.
>
> I'm afraid you're mistaken here. See __devm_ioremap() which can return
> NULL.
>
Uh, you are right, I only checked devm_of_iomap in qmp_usb_iomap().
Anyway, the fix should be different - given function should either
return ERR or NULL, not both, so devm_ioremap return value needs to be
wrapped in ERR_PTR.
Best regards,
Krzysztof
WARNING: multiple messages have this Message-ID (diff)
From: Krzysztof Kozlowski <krzk@kernel.org>
To: Johan Hovold <johan@kernel.org>
Cc: Chenyuan Yang <chenyuan0y@gmail.com>,
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
Subject: Re: [PATCH] phy: qcom-qmp-usb: Fix an NULL vs IS_ERR() bug
Date: Mon, 14 Apr 2025 10:08:18 +0200 [thread overview]
Message-ID: <f3b77aa4-e7a4-475f-a633-48aab59fa9b1@kernel.org> (raw)
In-Reply-To: <Z_y73a5IDO66AzY1@hovoldconsulting.com>
On 14/04/2025 09:40, Johan Hovold wrote:
> On Mon, Apr 14, 2025 at 09:30:19AM +0200, Krzysztof Kozlowski wrote:
>> On 13/04/2025 23:25, Chenyuan Yang wrote:
>>> In qmp_usb_iomap(), one branch returns the result of devm_ioremap(), which
>>> can be NULL. Since IS_ERR() does not catch a NULL pointer,
>>
>> No, that's not true. NAK.
>
> I'm afraid you're mistaken here. See __devm_ioremap() which can return
> NULL.
>
Uh, you are right, I only checked devm_of_iomap in qmp_usb_iomap().
Anyway, the fix should be different - given function should either
return ERR or NULL, not both, so devm_ioremap return value needs to be
wrapped in ERR_PTR.
Best regards,
Krzysztof
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
next prev parent reply other threads:[~2025-04-14 8:08 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-13 21:25 [PATCH] phy: qcom-qmp-usb: Fix an NULL vs IS_ERR() bug Chenyuan Yang
2025-04-13 21:25 ` Chenyuan Yang
2025-04-14 6:57 ` Johan Hovold
2025-04-14 6:57 ` Johan Hovold
2025-04-14 7:30 ` Krzysztof Kozlowski
2025-04-14 7:30 ` Krzysztof Kozlowski
2025-04-14 7:40 ` Johan Hovold
2025-04-14 7:40 ` Johan Hovold
2025-04-14 8:08 ` Krzysztof Kozlowski [this message]
2025-04-14 8:08 ` Krzysztof Kozlowski
2025-04-14 8:13 ` Johan Hovold
2025-04-14 8:13 ` Johan Hovold
2025-04-14 12:52 ` Chenyuan Yang
2025-04-14 12:52 ` Chenyuan Yang
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=f3b77aa4-e7a4-475f-a633-48aab59fa9b1@kernel.org \
--to=krzk@kernel.org \
--cc=chenyuan0y@gmail.com \
--cc=johan+linaro@kernel.org \
--cc=johan@kernel.org \
--cc=kishon@kernel.org \
--cc=konrad.dybcio@oss.qualcomm.com \
--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 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.