netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Robb Manes <rmanes@redhat.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, amirv@mellanox.com, eyalpe@mellanox.com,
	ogerlitz@mellanox.com, Robb Manes <rmanes@redhat.com>
Subject: [PATCH v2] net/mlx4: Handle return codes in mlx4_qp_attach_common
Date: Tue, 29 Sep 2015 11:03:37 -0400	[thread overview]
Message-ID: <1443539017-4851-1-git-send-email-rmanes@redhat.com> (raw)
In-Reply-To: <20150928.222642.1395622340146984028.davem@davemloft.net>

Both new_steering_entry() and existing_steering_entry() return values
based on their success or failure, but currently they fall through
silently.  This can make troubleshooting difficult, as we were unable
to tell which one of these two functions returned errors or
specifically what code was returned.  This patch remedies that
situation by passing the return codes to err, which is returned by
mlx4_qp_attach_common() itself.

This also addresses a leak in the call to mlx4_bitmap_free() as well.

Signed-off-by: Robb Manes <rmanes@redhat.com>
---
Sorry about the poor formatting; I should have used git-send properly.

 drivers/net/ethernet/mellanox/mlx4/mcg.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx4/mcg.c b/drivers/net/ethernet/mellanox/mlx4/mcg.c
index bd9ea0d..1d4e2e0 100644
--- a/drivers/net/ethernet/mellanox/mlx4/mcg.c
+++ b/drivers/net/ethernet/mellanox/mlx4/mcg.c
@@ -1184,10 +1184,11 @@ out:
 	if (prot == MLX4_PROT_ETH) {
 		/* manage the steering entry for promisc mode */
 		if (new_entry)
-			new_steering_entry(dev, port, steer, index, qp->qpn);
+			err = new_steering_entry(dev, port, steer,
+						 index, qp->qpn);
 		else
-			existing_steering_entry(dev, port, steer,
-						index, qp->qpn);
+			err = existing_steering_entry(dev, port, steer,
+						      index, qp->qpn);
 	}
 	if (err && link && index != -1) {
 		if (index < dev->caps.num_mgms)
-- 
2.4.3

  reply	other threads:[~2015-09-29 15:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-25 14:39 [PATCH] net/mlx4: Handle return codes in mlx4_qp_attach_common Robb Manes
2015-09-27  4:31 ` Or Gerlitz
2015-09-29  5:26 ` David Miller
2015-09-29 15:03   ` Robb Manes [this message]
2015-09-30  4:15     ` [PATCH v2] " David Miller

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=1443539017-4851-1-git-send-email-rmanes@redhat.com \
    --to=rmanes@redhat.com \
    --cc=amirv@mellanox.com \
    --cc=davem@davemloft.net \
    --cc=eyalpe@mellanox.com \
    --cc=netdev@vger.kernel.org \
    --cc=ogerlitz@mellanox.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).