netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net/mlx4: Handle return codes in mlx4_qp_attach_common
@ 2015-09-25 14:39 Robb Manes
  2015-09-27  4:31 ` Or Gerlitz
  2015-09-29  5:26 ` David Miller
  0 siblings, 2 replies; 5+ messages in thread
From: Robb Manes @ 2015-09-25 14:39 UTC (permalink / raw)
  To: netdev; +Cc: Amir Vadai, Eyal Perry, ogerlitz

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>
---
 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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-09-30  4:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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   ` [PATCH v2] " Robb Manes
2015-09-30  4:15     ` David Miller

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).