netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
To: Roland Dreier <rdreier@cisco.com>
Cc: netdev@vger.kernel.org,
	Christoph Lameter <cl@linux-foundation.org>,
	general@lists.openfabrics.org
Subject: Re: [ofa-general][PATCH] mlx4: FIX error flow when initializing EQ table
Date: Wed, 10 Jun 2009 09:52:26 +0300	[thread overview]
Message-ID: <4A2F582A.7050106@mellanox.co.il> (raw)
In-Reply-To: <adavdn53zkw.fsf@cisco.com>

Roland Dreier wrote:
>  > If mlx4_create_eq() would fail for one of EQ's assigned for
>  > completion handling, the code would try to free the same EQ
>  > we failed to create.
>  > The crash was found by Christoph Lameter
> 
> Thanks, good catch.  However looking at the code it seems that a simpler
> way to fix this would be as below.  Can you confirm that this works too?
> ---
>  drivers/net/mlx4/eq.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/mlx4/eq.c b/drivers/net/mlx4/eq.c
> index 8830dcb..033817e 100644
> --- a/drivers/net/mlx4/eq.c
> +++ b/drivers/net/mlx4/eq.c
> @@ -677,12 +677,12 @@ err_out_async:
>  	mlx4_free_eq(dev, &priv->eq_table.eq[dev->caps.num_comp_vectors]);
>  
>  err_out_comp:
> -	i = dev->caps.num_comp_vectors - 1;
> +	i = dev->caps.num_comp_vectors;
>  
>  err_out_unmap:
> -	while (i >= 0) {
> -		mlx4_free_eq(dev, &priv->eq_table.eq[i]);
> +	while (i > 0) {
>  		--i;
> +		mlx4_free_eq(dev, &priv->eq_table.eq[i]);
>  	}
>  	mlx4_unmap_clr_int(dev);
>  	mlx4_free_irqs(dev);
> 
Yes, it also works
Yevgeny

      reply	other threads:[~2009-06-10  6:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-07 15:16 [ofa-general][PATCH] mlx4: FIX error flow when initializing EQ table Yevgeny Petrilin
2009-06-08  7:40 ` David Miller
2009-06-09 20:46 ` Roland Dreier
2009-06-10  6:52   ` Yevgeny Petrilin [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=4A2F582A.7050106@mellanox.co.il \
    --to=yevgenyp@mellanox.co.il \
    --cc=cl@linux-foundation.org \
    --cc=general@lists.openfabrics.org \
    --cc=netdev@vger.kernel.org \
    --cc=rdreier@cisco.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;
as well as URLs for NNTP newsgroup(s).