ixgbe: Fix FCOE memory leak for DDP packets
authorAlexander Duyck <alexander.h.duyck@intel.com>
Thu, 2 Jun 2011 04:29:23 +0000 (04:29 +0000)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Sat, 13 Aug 2011 09:10:27 +0000 (02:10 -0700)
This patch is meant to fix a memory leak found via code review for FCOE.
Specifically on DDP flows the SKBs were being dropped without being
recycled, freed, or given to the stack.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ixgbe/ixgbe_main.c

index e86297b32733e8a0af34a329a3f839ce2c57205b..22790394318a06085290e179f88647e97480271b 100644 (file)
@@ -1459,8 +1459,10 @@ static void ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector,
                if (ixgbe_rx_is_fcoe(adapter, rx_desc)) {
                        ddp_bytes = ixgbe_fcoe_ddp(adapter, rx_desc, skb,
                                                   staterr);
-                       if (!ddp_bytes)
+                       if (!ddp_bytes) {
+                               dev_kfree_skb_any(skb);
                                goto next_desc;
+                       }
                }
 #endif /* IXGBE_FCOE */
                ixgbe_receive_skb(q_vector, skb, staterr, rx_ring, rx_desc);