[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aOVCgXnHDnErCLnu@stanley.mountain>
Date: Tue, 7 Oct 2025 19:40:33 +0300
From: Dan Carpenter <dan.carpenter@...aro.org>
To: Rakuram Eswaran <rakuram.e96@...il.com>
Cc: ulf.hansson@...aro.org, zhoubinbin@...ngson.cn,
u.kleine-koenig@...libre.com, chenhuacai@...nel.org,
david.hunter.linux@...il.com, skhan@...uxfoundation.org,
khalid@...nel.org, linux-mmc@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-kernel-mentees@...ts.linux.dev,
kernel test robot <lkp@...el.com>
Subject: Re: [PATCH] mmc: pxamci: Fix passing NULL to PTR_ERR() in
pxamci_probe()
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@...el.com>
> Reported-by: Dan Carpenter <dan.carpenter@...aro.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@...il.com>
> ---
Thanks!
Reviewed-by: Dan Carpenter <dan.carpenter@...aro.org>
regards,
dan carpenter
Powered by blists - more mailing lists