netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: idosch@idosch.org
Cc: netdev@vger.kernel.org, jiri@mellanox.com, mlxsw@mellanox.com,
	idosch@mellanox.com
Subject: Re: [PATCH net] mlxsw: spectrum_mr: Fix list iteration in error path
Date: Thu, 26 Mar 2020 12:01:29 -0700 (PDT)	[thread overview]
Message-ID: <20200326.120129.10247438354279964.davem@davemloft.net> (raw)
In-Reply-To: <20200326141733.1395337-1-idosch@idosch.org>

From: Ido Schimmel <idosch@idosch.org>
Date: Thu, 26 Mar 2020 16:17:33 +0200

> From: Ido Schimmel <idosch@mellanox.com>
> 
> list_for_each_entry_from_reverse() iterates backwards over the list from
> the current position, but in the error path we should start from the
> previous position.
> 
> Fix this by using list_for_each_entry_continue_reverse() instead.
> 
> This suppresses the following error from coccinelle:
> 
> drivers/net/ethernet/mellanox/mlxsw//spectrum_mr.c:655:34-38: ERROR:
> invalid reference to the index variable of the iterator on line 636
> 
> Fixes: c011ec1bbfd6 ("mlxsw: spectrum: Add the multicast routing offloading logic")
> Signed-off-by: Ido Schimmel <idosch@mellanox.com>
> Reviewed-by: Jiri Pirko <jiri@mellanox.com>

Applied and queued up for -stable, thanks.

      reply	other threads:[~2020-03-26 19:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-26 14:17 [PATCH net] mlxsw: spectrum_mr: Fix list iteration in error path Ido Schimmel
2020-03-26 19:01 ` David Miller [this message]

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=20200326.120129.10247438354279964.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=idosch@idosch.org \
    --cc=idosch@mellanox.com \
    --cc=jiri@mellanox.com \
    --cc=mlxsw@mellanox.com \
    --cc=netdev@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).