mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: Johan Hovold <johan@kernel.org>, linux-mtd@lists.infradead.org
Cc: LKML <linux-kernel@vger.kernel.org>,
	Miquel Raynal <miquel.raynal@bootlin.com>,
	Richard Weinberger <richard@nod.at>,
	Vignesh Raghavendra <vigneshr@ti.com>
Subject: Re: [PATCH] mtd: rawnand: omap2: fix device leak on probe failure
Date: Tue, 23 Sep 2025 19:05:19 +0200	[thread overview]
Message-ID: <1341dc6b-49da-44f9-8b57-6828a64114fe@web.de> (raw)
In-Reply-To: <20250922152204.15702-1-johan@kernel.org>

…
> +++ b/drivers/mtd/nand/raw/omap2.c
> @@ -2054,7 +2054,8 @@ static int omap_nand_attach_chip(struct nand_chip *chip)
>  		break;
>  	default:
>  		dev_err(dev, "Invalid or unsupported ECC scheme\n");
> -		return -EINVAL;
> +		err = -EINVAL;
> +		goto err_put_elm_dev;
>  	}
>  
>  	if (elm_bch_strength >= 0) {
> @@ -2083,10 +2084,24 @@ static int omap_nand_attach_chip(struct nand_chip *chip)
>  		dev_err(dev,
>  			"Not enough OOB bytes: required = %d, available=%d\n",
>  			min_oobbytes, mtd->oobsize);
> -		return -EINVAL;
> +		err = -EINVAL;
> +		goto err_put_elm_dev;
>  	}
…

May such an error code assignment be moved behind an additional label?

Regards,
Markus

  reply	other threads:[~2025-09-23 17:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-22 15:22 Johan Hovold
2025-09-23 17:05 ` Markus Elfring [this message]
2025-09-24  7:43   ` Miquel Raynal
2025-09-29 15:55 ` Miquel Raynal

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=1341dc6b-49da-44f9-8b57-6828a64114fe@web.de \
    --to=markus.elfring@web.de \
    --cc=johan@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=miquel.raynal@bootlin.com \
    --cc=richard@nod.at \
    --cc=vigneshr@ti.com \
    /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®