From: Stefan Agner <stefan@agner.ch>
To: Alexey Khoroshilov <khoroshilov@ispras.ru>
Cc: Boris Brezillon <boris.brezillon@free-electrons.com>,
Richard Weinberger <richard@nod.at>,
linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org,
ldv-project@linuxtesting.org
Subject: Re: [PATCH v4 3/3] mtd: nand: vf610: check mtd_device_register() return code
Date: Sat, 10 Feb 2018 10:43:19 +0100 [thread overview]
Message-ID: <8a096fc8dd3afbf9068a0b7856fc8a69@agner.ch> (raw)
In-Reply-To: <1518215316-21504-4-git-send-email-khoroshilov@ispras.ru>
On 09.02.2018 23:28, Alexey Khoroshilov wrote:
> vf610_nfc_probe() misses error handling of mtd_device_register().
>
> Found by Linux Driver Verification project (linuxtesting.org).
>
> Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Looks good to me, and seems to work fine, thanks for fixing this!
For the complete patchset:
Reviewed-by: Stefan Agner <stefan@agner.ch>
--
Stefan
> ---
> drivers/mtd/nand/vf610_nfc.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/mtd/nand/vf610_nfc.c b/drivers/mtd/nand/vf610_nfc.c
> index 9cc5992e88c8..64fed3d9e3d4 100644
> --- a/drivers/mtd/nand/vf610_nfc.c
> +++ b/drivers/mtd/nand/vf610_nfc.c
> @@ -782,8 +782,13 @@ static int vf610_nfc_probe(struct platform_device *pdev)
> platform_set_drvdata(pdev, mtd);
>
> /* Register device in MTD */
> - return mtd_device_register(mtd, NULL, 0);
> + err = mtd_device_register(mtd, NULL, 0);
> + if (err)
> + goto err_cleanup_nand;
> + return 0;
>
> +err_cleanup_nand:
> + nand_cleanup(chip);
> err_disable_clk:
> clk_disable_unprepare(nfc->clk);
> return err;
next prev parent reply other threads:[~2018-02-10 9:43 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-22 21:43 [PATCH] mtd: nand: vf610: fix error handling in vf610_nfc_probe() Alexey Khoroshilov
2017-12-22 21:57 ` Boris Brezillon
2017-12-23 19:18 ` [PATCH v2] " Alexey Khoroshilov
2018-01-06 9:12 ` Boris Brezillon
2018-01-06 9:25 ` Boris Brezillon
2018-01-26 22:32 ` [PATCH v3] " Alexey Khoroshilov
2018-01-30 13:11 ` Boris Brezillon
2018-02-09 22:28 ` [PATCH v4 0/3] " Alexey Khoroshilov
2018-02-09 22:28 ` [PATCH v4 1/3] mtd: nand: vf610: remove the unnecessary of_node_put() Alexey Khoroshilov
2018-02-09 22:28 ` [PATCH v4 2/3] mtd: nand: vf610: improve readability of error label Alexey Khoroshilov
2018-02-09 22:28 ` [PATCH v4 3/3] mtd: nand: vf610: check mtd_device_register() return code Alexey Khoroshilov
2018-02-10 9:43 ` Stefan Agner [this message]
2018-02-12 21:31 ` [PATCH v4 0/3] mtd: nand: vf610: fix error handling in vf610_nfc_probe() Boris Brezillon
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=8a096fc8dd3afbf9068a0b7856fc8a69@agner.ch \
--to=stefan@agner.ch \
--cc=boris.brezillon@free-electrons.com \
--cc=khoroshilov@ispras.ru \
--cc=ldv-project@linuxtesting.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--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
Powered by JetHome