All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ajay Singh <ajay.kathat@microchip.com>
To: <linux-wireless@vger.kernel.org>
Cc: <devel@driverdev.osuosl.org>, <gregkh@linuxfoundation.org>,
	<ganesh.krishna@microchip.com>, <venkateswara.kaja@microchip.com>,
	<aditya.shankar@microchip.com>, <claudiu.beznea@microchip.com>,
	<adham.abozaeid@Microchip.com>,
	Ajay Singh <ajay.kathat@microchip.com>
Subject: [PATCH 08/12] staging: wilc1000: handle freeing of key data in wilc_add_ptk()
Date: Tue, 26 Jun 2018 11:37:10 +0530	[thread overview]
Message-ID: <1529993234-27294-9-git-send-email-ajay.kathat@microchip.com> (raw)
In-Reply-To: <1529993234-27294-1-git-send-email-ajay.kathat@microchip.com>

Handle freeing of memory allocated to store the 'key' in wilc_add_ptk()
function. Once work completion notification is received, free the
memory allocated to avoid missing of free in work function sepecially
for error scenario.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
---
 drivers/staging/wilc1000/host_interface.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 2cc9689..2062f4e 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -1724,7 +1724,6 @@ static void handle_key(struct work_struct *work)
 
 out_wpa_ptk:
 		complete(&msg->work_comp);
-		kfree(hif_key->attr.wpa.key);
 		break;
 
 	case PMKSA:
@@ -2735,8 +2734,6 @@ int wilc_add_ptk(struct wilc_vif *vif, const u8 *ptk, u8 ptk_key_len,
 	}
 
 	wait_for_completion(&msg->work_comp);
-	kfree(msg);
-	return 0;
 
 free_key:
 	kfree(msg->body.key_info.attr.wpa.key);
-- 
2.7.4

  parent reply	other threads:[~2018-06-26  6:07 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-26  6:07 [PATCH 00/12] staging: wilc1000: address TODO item to remove host_if_work() Ajay Singh
2018-06-26  6:07 ` [PATCH 01/12] staging: wilc1000: remove host_if_work() to handle TODO list issue Ajay Singh
2018-06-26  6:07 ` [PATCH 02/12] staging: wilc1000: remove unused marco related to HIF commands Ajay Singh
2018-06-26  6:07 ` [PATCH 03/12] staging: wilc1000: move the allocation of cmd out of wilc_enqueue_cmd() Ajay Singh
2018-06-26  6:07 ` [PATCH 04/12] staging: wilc1000: added 'work_comp' completion as part of host_if_msg Ajay Singh
2018-06-26  6:07 ` [PATCH 05/12] staging: wilc1000: remove 'hif_thread_comp' completions Ajay Singh
2018-06-26  6:07 ` [PATCH 06/12] staging: wilc1000: rename wilc_enqueue_cmd() to wilc_enqueue_work() Ajay Singh
2018-06-26  6:07 ` [PATCH 07/12] staging: wilc1000: handle freeing of key data in wep add key Ajay Singh
2018-06-26  6:07 ` Ajay Singh [this message]
2018-06-26  6:07 ` [PATCH 09/12] staging: wilc1000: handle freeing of 'key' & 'seq' data in wilc_add_rx_gtk() Ajay Singh
2018-06-26  6:07 ` [PATCH 10/12] staging: wilc1000: avoid use of static variable 'inactive_time' Ajay Singh
2018-06-26  6:07 ` [PATCH 11/12] staging: wilc1000: avoid use of static variable 'rssi' Ajay Singh
2018-06-26  6:07 ` [PATCH 12/12] staging: wilc1000: updated TODO file Ajay Singh
2018-06-26  7:48 ` [PATCH 00/12] staging: wilc1000: address TODO item to remove host_if_work() Claudiu Beznea

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=1529993234-27294-9-git-send-email-ajay.kathat@microchip.com \
    --to=ajay.kathat@microchip.com \
    --cc=adham.abozaeid@Microchip.com \
    --cc=aditya.shankar@microchip.com \
    --cc=claudiu.beznea@microchip.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=ganesh.krishna@microchip.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=venkateswara.kaja@microchip.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.