[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Tue, 8 Aug 2023 23:19:29 +0530
From: Harshit Mogalapalli <harshit.m.mogalapalli@...cle.com>
To: Ulf Hansson <ulf.hansson@...aro.org>
Cc: Tony Huang <tonyhuang.sunplus@...il.com>,
Li-hao Kuo <lhjeff911@...il.com>,
Arnd Bergmann <arnd@...db.de>, linux-mmc@...r.kernel.org,
linux-kernel@...r.kernel.org, dan.carpenter@...aro.org,
kernel-janitors@...r.kernel.org, error27@...il.com
Subject: Re: [PATCH next] mmc: sunplus: Fix error handling in
spmmc_drv_probe()
Hi,
On 08/08/23 2:30 pm, Ulf Hansson wrote:
> On Tue, 1 Aug 2023 at 07:23, Harshit Mogalapalli
> <harshit.m.mogalapalli@...cle.com> wrote:
>>
>> There are few issues in spmmc_drv_probe():
>>
>> 1. When mmc allocation fails, goto is a no-op.
>> 2. When mmc allocation succeeds, the error paths should use goto instead
>> of direct return.
>
> Rather than adding a bunch of new "gotos", how about converting into
> using devm_mmc_alloc_host()?
>
Thanks for the suggestion. Yes it would reduce many "gotos".
Will send a V2 with the changes.
>> 3. platform_get_irq() doesn't return zero, so '<' is sufficient.
>>
(Also will split this into different patch as it's fixing a different
thing than above.)
Thanks,
Harshit
>> Fix the above issues by adding goto instead of direct return, also
>> remove NULL check in 'probe_free_host' as we changed the goto to return
>> when mmc_alloc_host() fails.
>>
>> Fixes: 4e268fed8b18 ("mmc: Add mmc driver for Sunplus SP7021")
>> Reported-by: Dan Carpenter <dan.carpenter@...aro.org>
>> Closes: https://lore.kernel.org/all/a3829ed3-d827-4b9d-827e-9cc24a3ec3bc@moroto.mountain/
>> Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@...cle.com>
>
> Other than the above, this looks good to me!
>
> Kind regards
> Uffe
Powered by blists - more mailing lists