mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Alexander Aring <alex.aring@gmail.com>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH] mtd: nand-bb: use list_for_each_entry_safe
Date: Tue, 29 Apr 2014 15:19:07 +0200	[thread overview]
Message-ID: <20140429131905.GA18565@omega> (raw)
In-Reply-To: <1398751606-10167-1-git-send-email-s.hauer@pengutronix.de>

Hi,

thanks Sascha.

On Tue, Apr 29, 2014 at 08:06:46AM +0200, Sascha Hauer wrote:
> We need list_for_each_entry_safe in dev_remove_bb_dev since the
> list entries are removed during iteration over the list.
> 
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> Reported-by: Alexander Aring <alex.aring@gmail.com>
> ---
>  drivers/mtd/nand/nand-bb.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mtd/nand/nand-bb.c b/drivers/mtd/nand/nand-bb.c
> index f387ef6..89d5945 100644
> --- a/drivers/mtd/nand/nand-bb.c
> +++ b/drivers/mtd/nand/nand-bb.c
> @@ -308,9 +308,9 @@ out1:
>  
>  int dev_remove_bb_dev(const char *name)
>  {
> -	struct nand_bb *bb;
> +	struct nand_bb *bb, *tmp;
>  
> -	list_for_each_entry(bb, &bb_list, list) {
> +	list_for_each_entry_safe(bb, tmp, &bb_list, list) {
>  		if (!strcmp(bb->cdev.name, name)) {
>  			devfs_remove(&bb->cdev);
>  			cdev_close(bb->cdev_parent);

Fixes f4af6690e41e1f1b995b5b3b56016c8a8fcd3246
("nand-bb: Fix remove of nand-bb device.")

- Alex

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2014-04-29 13:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-29  6:06 Sascha Hauer
2014-04-29 13:19 ` Alexander Aring [this message]
2014-05-03 11:32 ` Alexander Aring
2014-05-07  8:09   ` Sascha Hauer

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=20140429131905.GA18565@omega \
    --to=alex.aring@gmail.com \
    --cc=barebox@lists.infradead.org \
    --cc=s.hauer@pengutronix.de \
    /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