From: Dan Carpenter <dan.carpenter@linaro.org>
To: Rakuram Eswaran <rakuram.e96@gmail.com>
Cc: ulf.hansson@linaro.org, zhoubinbin@loongson.cn,
u.kleine-koenig@baylibre.com, chenhuacai@kernel.org,
david.hunter.linux@gmail.com, skhan@linuxfoundation.org,
khalid@kernel.org, linux-mmc@vger.kernel.org,
linux-kernel@vger.kernel.org,
linux-kernel-mentees@lists.linux.dev,
kernel test robot <lkp@intel.com>
Subject: Re: [PATCH] mmc: pxamci: Fix passing NULL to PTR_ERR() in pxamci_probe()
Date: Tue, 7 Oct 2025 19:40:33 +0300 [thread overview]
Message-ID: <aOVCgXnHDnErCLnu@stanley.mountain> (raw)
In-Reply-To: <20251007161948.12442-1-rakuram.e96@gmail.com>
On Tue, Oct 07, 2025 at 09:47:44PM +0530, Rakuram Eswaran wrote:
> Smatch reported:
> drivers/mmc/host/pxamci.c:709 pxamci_probe() warn: passing zero to 'PTR_ERR'
>
> Case 1:
> When dma_request_chan() fails, host->dma_chan_rx is an ERR_PTR(),
> but it is reset to NULL before using PTR_ERR(), resulting in PTR_ERR(0).
> This mistakenly returns 0 instead of the real error code.
>
> Case 2:
> When devm_clk_get() fails, host->clk is an ERR_PTR() resulting in the similar
> issue like case 1.
>
> Store the error code before nullifying the pointers in both the cases.
>
> Reported-by: kernel test robot <lkp@intel.com>
> Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
> Closes: https://lore.kernel.org/r/202510041841.pRlunIfl-lkp@intel.com/
> Fixes: 58c40f3faf742c ("mmc: pxamci: Use devm_mmc_alloc_host() helper")
> Signed-off-by: Rakuram Eswaran <rakuram.e96@gmail.com>
> ---
Thanks!
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
regards,
dan carpenter
next prev parent reply other threads:[~2025-10-07 16:40 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-07 16:17 [PATCH] mmc: pxamci: Fix passing NULL to PTR_ERR() in pxamci_probe() Rakuram Eswaran
2025-10-07 16:40 ` Dan Carpenter [this message]
2025-10-07 17:43 ` Khalid Aziz
2025-10-09 1:21 ` Binbin Zhou
2025-10-09 8:57 ` Uwe Kleine-König
2025-10-09 15:27 ` Rakuram Eswaran
2025-10-10 9:59 ` Uwe Kleine-König
2025-10-10 17:59 ` Khalid Aziz
2025-10-12 14:15 ` Uwe Kleine-König
2025-10-12 18:37 ` Rakuram Eswaran
2025-10-13 8:45 ` Uwe Kleine-König
2025-10-13 22:54 ` Khalid Aziz
2025-10-14 12:27 ` Dan Carpenter
2025-10-14 13:31 ` Khalid Aziz
2025-10-14 18:49 ` Rakuram Eswaran
2025-10-09 15:53 ` Khalid Aziz
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=aOVCgXnHDnErCLnu@stanley.mountain \
--to=dan.carpenter@linaro.org \
--cc=chenhuacai@kernel.org \
--cc=david.hunter.linux@gmail.com \
--cc=khalid@kernel.org \
--cc=linux-kernel-mentees@lists.linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=lkp@intel.com \
--cc=rakuram.e96@gmail.com \
--cc=skhan@linuxfoundation.org \
--cc=u.kleine-koenig@baylibre.com \
--cc=ulf.hansson@linaro.org \
--cc=zhoubinbin@loongson.cn \
/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