From: Dan Carpenter <dan.carpenter@linaro.org>
To: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Cc: tonyhuang.sunplus@gmail.com, lhjeff911@gmail.com,
ulf.hansson@linaro.org, arnd@arndb.de, linux-mmc@vger.kernel.org,
linux-kernel@vger.kernel.org, error27@gmail.com,
kernel-janitors@vger.kernel.org
Subject: Re: [PATCH next v2 1/2] mmc: sunplus: Fix error handling in spmmc_drv_probe()
Date: Wed, 9 Aug 2023 10:40:30 +0300 [thread overview]
Message-ID: <d4eb3558-c270-4aea-94a8-b24b8d3a1987@kadam.mountain> (raw)
In-Reply-To: <20230809071812.547229-1-harshit.m.mogalapalli@oracle.com>
On Wed, Aug 09, 2023 at 12:18:11AM -0700, Harshit Mogalapalli wrote:
> When mmc allocation succeeds, the error paths are not freeing mmc.
>
> Fix the above issue by changing mmc_alloc_host() to devm_mmc_alloc_host()
> to simplify the error handling. Remove label 'probe_free_host' as devm_*
> api takes care of freeing, also remove mmc_free_host() from remove
> function as devm_* takes care of freeing.
>
> Fixes: 4e268fed8b18 ("mmc: Add mmc driver for Sunplus SP7021")
> Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
> Closes: https://lore.kernel.org/all/a3829ed3-d827-4b9d-827e-9cc24a3ec3bc@moroto.mountain/
> Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
> ---
> This is based on static analysis with smatch, only compile tested.
>
> v1->v2: Simplify code by using devm_mmc_alloc_host() instead of
> mmc_alloc_host() (Ulf Hansson's suggestion)
Nice.
Both patches look good to me.
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
regards,
dan carpenter
next prev parent reply other threads:[~2023-08-09 7:40 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-09 7:18 Harshit Mogalapalli
2023-08-09 7:18 ` [PATCH next v2 2/2] mmc: sunplus: Fix platform_get_irq() error checking Harshit Mogalapalli
2023-08-09 11:33 ` Ulf Hansson
2023-08-09 11:51 ` Dan Carpenter
2023-08-09 13:41 ` Ulf Hansson
2023-08-09 7:40 ` Dan Carpenter [this message]
2023-08-09 11:08 ` [PATCH next v2 1/2] mmc: sunplus: Fix error handling in spmmc_drv_probe() Ulf Hansson
2023-08-09 11:17 ` Ulf Hansson
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=d4eb3558-c270-4aea-94a8-b24b8d3a1987@kadam.mountain \
--to=dan.carpenter@linaro.org \
--cc=arnd@arndb.de \
--cc=error27@gmail.com \
--cc=harshit.m.mogalapalli@oracle.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=lhjeff911@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=tonyhuang.sunplus@gmail.com \
--cc=ulf.hansson@linaro.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®