From: Yevgeny Petrilin <yevgenyp@mellanox•co.il>
To: rdreier@cisco•com
Cc: netdev@vger•kernel.org,
Christoph Lameter <cl@linux-foundation•org>,
general@lists•openfabrics.org
Subject: [ofa-general][PATCH] mlx4: FIX error flow when initializing EQ table
Date: Sun, 07 Jun 2009 18:16:09 +0300 [thread overview]
Message-ID: <4A2BD9B9.6000802@mellanox.co.il> (raw)
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
Signed-off-by: Yevgeny Petrilin <yevgenyp@mellanox•co.il>
---
drivers/net/mlx4/eq.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/drivers/net/mlx4/eq.c b/drivers/net/mlx4/eq.c
index 8830dcb..dee1887 100644
--- a/drivers/net/mlx4/eq.c
+++ b/drivers/net/mlx4/eq.c
@@ -623,8 +623,10 @@ int mlx4_init_eq_table(struct mlx4_dev *dev)
err = mlx4_create_eq(dev, dev->caps.num_cqs + MLX4_NUM_SPARE_EQE,
(dev->flags & MLX4_FLAG_MSI_X) ? i : 0,
&priv->eq_table.eq[i]);
- if (err)
+ if (err) {
+ --i;
goto err_out_unmap;
+ }
}
err = mlx4_create_eq(dev, MLX4_NUM_ASYNC_EQE + MLX4_NUM_SPARE_EQE,
--
1.6.1.3
next reply other threads:[~2009-06-07 15:16 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-07 15:16 Yevgeny Petrilin [this message]
2009-06-08 7:40 ` [ofa-general][PATCH] mlx4: FIX error flow when initializing EQ table David Miller
2009-06-09 20:46 ` Roland Dreier
2009-06-10 6:52 ` Yevgeny Petrilin
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=4A2BD9B9.6000802@mellanox.co.il \
--to=yevgenyp@mellanox$(echo .)co.il \
--cc=cl@linux-foundation$(echo .)org \
--cc=general@lists$(echo .)openfabrics.org \
--cc=netdev@vger$(echo .)kernel.org \
--cc=rdreier@cisco$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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