netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: davem@davemloft.net
Cc: Wenwen Wang <wenwen@cs.uga.edu>,
	netdev@vger.kernel.org, nhorman@redhat.com, sassmann@redhat.com,
	Andrew Bowers <andrewx.bowers@intel.com>,
	Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Subject: [net-next 01/14] ixgbe: fix memory leaks
Date: Tue, 10 Sep 2019 09:34:21 -0700	[thread overview]
Message-ID: <20190910163434.2449-2-jeffrey.t.kirsher@intel.com> (raw)
In-Reply-To: <20190910163434.2449-1-jeffrey.t.kirsher@intel.com>

From: Wenwen Wang <wenwen@cs.uga.edu>

In ixgbe_configure_clsu32(), 'jump', 'input', and 'mask' are allocated
through kzalloc() respectively in a for loop body. Then,
ixgbe_clsu32_build_input() is invoked to build the input. If this process
fails, next iteration of the for loop will be executed. However, the
allocated 'jump', 'input', and 'mask' are not deallocated on this execution
path, leading to memory leaks.

Signed-off-by: Wenwen Wang <wenwen@cs.uga.edu>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 99df595abfba..95c0827dfd4c 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -9490,6 +9490,10 @@ static int ixgbe_configure_clsu32(struct ixgbe_adapter *adapter,
 				jump->mat = nexthdr[i].jump;
 				adapter->jump_tables[link_uhtid] = jump;
 				break;
+			} else {
+				kfree(mask);
+				kfree(input);
+				kfree(jump);
 			}
 		}
 		return 0;
-- 
2.21.0


  reply	other threads:[~2019-09-10 16:34 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-10 16:34 [net-next 00/14][pull request] Intel Wired LAN Driver Updates 2019-09-10 Jeff Kirsher
2019-09-10 16:34 ` Jeff Kirsher [this message]
2019-09-10 16:34 ` [net-next 02/14] i40e: check __I40E_VF_DISABLE bit in i40e_sync_filters_subtask Jeff Kirsher
2019-09-10 16:34 ` [net-next 03/14] ixgbe: use skb_get_queue_mapping in tx path Jeff Kirsher
2019-09-10 16:34 ` [net-next 04/14] i40e: use ktime_get_real_ts64 instead of ktime_to_timespec64 Jeff Kirsher
2019-09-10 16:34 ` [net-next 05/14] i40e: remove I40E_AQC_ADD_CLOUD_FILTER_OIP Jeff Kirsher
2019-09-10 16:34 ` [net-next 06/14] i40e: mark additional missing bits as reserved Jeff Kirsher
2019-09-10 16:34 ` [net-next 07/14] i40e: fix missed "Negotiated" string in i40e_print_link_message() Jeff Kirsher
2019-09-10 16:34 ` [net-next 08/14] i40e: Fix message for other card without FEC Jeff Kirsher
2019-09-10 16:34 ` [net-next 09/14] i40e: use BIT macro to specify the cloud filter field flags Jeff Kirsher
2019-09-10 16:34 ` [net-next 10/14] i40e: clear __I40E_VIRTCHNL_OP_PENDING on invalid min Tx rate Jeff Kirsher
2019-09-10 16:34 ` [net-next 11/14] ixgbe: Prevent u8 wrapping of ITR value to something less than 10us Jeff Kirsher
2019-09-10 22:19   ` Alexander Duyck
2019-09-11  8:24   ` David Miller
2019-09-10 16:34 ` [net-next 12/14] iavf: fix MAC address setting for VFs when filter is rejected Jeff Kirsher
2019-09-10 16:34 ` [net-next 13/14] net/ixgbevf: make array api static const, makes object smaller Jeff Kirsher
2019-09-10 16:34 ` [net-next 14/14] i40e: fix potential RX buffer starvation for AF_XDP Jeff Kirsher

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=20190910163434.2449-2-jeffrey.t.kirsher@intel.com \
    --to=jeffrey.t.kirsher@intel.com \
    --cc=andrewx.bowers@intel.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=nhorman@redhat.com \
    --cc=sassmann@redhat.com \
    --cc=wenwen@cs.uga.edu \
    /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).