public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: "Rafał Miłecki" <rafal@milecki.pl>
Cc: Yang Rong <yangrong@vivo.com>,
	Richard Weinberger <richard@nod.at>,
	Vignesh Raghavendra <vigneshr@ti.com>,
	linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org,
	opensource.kernel@vivo.com, luhongfei@vivo.com
Subject: Re: [PATCH v3] mtd: core: Fix resource leak in a for_each_child_of_node() loop
Date: Wed, 12 Jul 2023 14:18:50 +0200	[thread overview]
Message-ID: <20230712141850.0f30c70c@xps-13> (raw)
In-Reply-To: <ffc8f6162a863179f88304ed8801d44f@milecki.pl>

Hi Rafał,

rafal@milecki.pl wrote on Tue, 11 Jul 2023 18:37:42 +0200:

> On 2023-07-11 04:03, Yang Rong wrote:
> > Ensure child node references are properly decremented in the error path
> >   of this function implementation.  
> 
> Nitpicking: it's actually a /success/ code path that misses
> of_node_put().

Please also add:

Cc: stable...

> 
> 
> > Fixes: 2df11f00100d ("mtd: core: try to find OF node for every MTD > partition")
> > Signed-off-by: Yang Rong <yangrong@vivo.com>  
> 
> Acked-by: Rafał Miłecki <rafal@milecki.pl>
> 
> 
> > ---
> > v2: > https://lore.kernel.org/all/20230710061412.2272-1-yangrong@vivo.com/
> > The modifications made copared to the previous version are as follows:
> > 1.Optimized the expression of the Subject, making it more accurate.
> > 2.Optimized the content of the commit message.
> > 3.Add the tag "Fixes".
> > 
> >  drivers/mtd/mtdcore.c | 1 +
> >  1 file changed, 1 insertion(+)
> >  mode change 100644 => 100755 drivers/mtd/mtdcore.c
> > 
> > diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c
> > index e00b12aa5ec9..b02cb8b1a38d
> > --- a/drivers/mtd/mtdcore.c
> > +++ b/drivers/mtd/mtdcore.c
> > @@ -591,6 +591,7 @@ static void mtd_check_of_node(struct mtd_info *mtd)
> >  		if (plen == mtd_name_len &&
> >  		    !strncmp(mtd->name, pname + offset, plen)) {
> >  			mtd_set_of_node(mtd, mtd_dn);
> > +			of_node_put(mtd_dn);
> >  			break;
> >  		}
> >  	}  


Thanks,
Miquèl

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

  reply	other threads:[~2023-07-12 12:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-11  2:03 [PATCH v3] mtd: core: Fix resource leak in a for_each_child_of_node() loop Yang Rong
2023-07-11 16:12 ` Markus Elfring
2023-07-11 16:30   ` Richard Weinberger
2023-07-11 16:37 ` Rafał Miłecki
2023-07-12 12:18   ` Miquel Raynal [this message]
2023-07-11 17:03 ` Markus Elfring

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=20230712141850.0f30c70c@xps-13 \
    --to=miquel.raynal@bootlin.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=luhongfei@vivo.com \
    --cc=opensource.kernel@vivo.com \
    --cc=rafal@milecki.pl \
    --cc=richard@nod.at \
    --cc=vigneshr@ti.com \
    --cc=yangrong@vivo.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