From: Boris Brezillon <boris.brezillon@free-electrons.com>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: kyungmin.park@samsung.com, dwmw2@infradead.org,
computersforpeace@gmail.com, marek.vasut@gmail.com,
richard@nod.at, cyrille.pitchen@wedev4u.fr,
linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] mtd: onenand: Fix an error handling path in 's3c_onenand_probe(()'
Date: Thu, 7 Dec 2017 17:55:52 +0100 [thread overview]
Message-ID: <20171207175552.4825e642@bbrezillon> (raw)
In-Reply-To: <20171118132723.24785-1-christophe.jaillet@wanadoo.fr>
On Sat, 18 Nov 2017 14:27:23 +0100
Christophe JAILLET <christophe.jaillet@wanadoo.fr> wrote:
> If 'platform_get_resource()' fails, we have to go through the error
> handling path to release some resources.
>
> The unreachable 'goto ahb_resource_failed' is also wrong here and we should
> go to 'resource_failed' instead.
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> drivers/mtd/onenand/samsung.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mtd/onenand/samsung.c b/drivers/mtd/onenand/samsung.c
> index af0ac1a7bf8f..164ebe2b1137 100644
> --- a/drivers/mtd/onenand/samsung.c
> +++ b/drivers/mtd/onenand/samsung.c
> @@ -872,8 +872,8 @@ static int s3c_onenand_probe(struct platform_device *pdev)
> r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> if (!r) {
> dev_err(&pdev->dev, "no memory resource defined\n");
> - return -ENOENT;
> - goto ahb_resource_failed;
> + err = -ENOENT;
> + goto resource_failed;
> }
>
Sorry but I'd really prefer to convert the driver to use devm_
functions instead of fixing a single error path.
> onenand->base_res = request_mem_region(r->start, resource_size(r),
next prev parent reply other threads:[~2017-12-07 16:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-18 13:27 [PATCH] mtd: onenand: Fix an error handling path in 's3c_onenand_probe(()' Christophe JAILLET
2017-12-07 16:55 ` Boris Brezillon [this message]
2017-12-08 21:15 ` Christophe JAILLET
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=20171207175552.4825e642@bbrezillon \
--to=boris.brezillon@free-electrons.com \
--cc=christophe.jaillet@wanadoo.fr \
--cc=computersforpeace@gmail.com \
--cc=cyrille.pitchen@wedev4u.fr \
--cc=dwmw2@infradead.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=kyungmin.park@samsung.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=marek.vasut@gmail.com \
--cc=richard@nod.at \
/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