linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Luca Coelho <luca@coelho.fi>
To: kvalo@codeaurora.org
Cc: linux-wireless@vger.kernel.org
Subject: [PATCH 7/8] iwlwifi: dbg_ini: fix memory leak in alloc_sgtable
Date: Fri,  4 Oct 2019 16:14:13 +0300	[thread overview]
Message-ID: <20191004131414.27372-8-luca@coelho.fi> (raw)
In-Reply-To: <20191004131414.27372-1-luca@coelho.fi>

From: Navid Emamdoost <navid.emamdoost@gmail.com>

In alloc_sgtable if alloc_page fails, the alocated table should be
released.

Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/fw/dbg.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/wireless/intel/iwlwifi/fw/dbg.c b/drivers/net/wireless/intel/iwlwifi/fw/dbg.c
index 5c8602de9168..87421807e040 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/dbg.c
+++ b/drivers/net/wireless/intel/iwlwifi/fw/dbg.c
@@ -646,6 +646,7 @@ static struct scatterlist *alloc_sgtable(int size)
 				if (new_page)
 					__free_page(new_page);
 			}
+			kfree(table);
 			return NULL;
 		}
 		alloc_size = min_t(int, size, PAGE_SIZE);
-- 
2.23.0


  parent reply	other threads:[~2019-10-04 13:14 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-04 13:14 [PATCH 0/8] iwlwifi: fixes intended for 5.4 2019-10-04 Luca Coelho
2019-10-04 13:14 ` [PATCH 1/8] iwlwifi: don't access trans_cfg via cfg Luca Coelho
2019-10-04 13:14 ` [PATCH 2/8] iwlwifi: fix ACPI table revision checks Luca Coelho
2019-10-04 13:14 ` [PATCH 3/8] iwlwifi: mvm: force single phy init Luca Coelho
2019-10-04 13:14 ` [PATCH 4/8] iwlwifi: mvm: fix race in sync rx queue notification Luca Coelho
2019-10-04 13:41   ` Kalle Valo
2019-10-04 18:06     ` Luca Coelho
2019-10-04 13:14 ` [PATCH 5/8] iwlwifi: pcie: fix indexing in command dump for new HW Luca Coelho
2019-10-04 13:14 ` [PATCH 6/8] iwlwifi: pcie: fix rb_allocator workqueue allocation Luca Coelho
2019-10-04 13:14 ` Luca Coelho [this message]
2019-10-04 13:14 ` [PATCH 8/8] iwlwifi: pcie: fix memory leaks in iwl_pcie_ctxt_info_gen3_init Luca Coelho

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=20191004131414.27372-8-luca@coelho.fi \
    --to=luca@coelho.fi \
    --cc=kvalo@codeaurora.org \
    --cc=linux-wireless@vger.kernel.org \
    /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).