All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] staging: wlan-ng: remove unnecessary kfree statements
@ 2023-03-10 20:59 Archana
  2023-03-10 20:59 ` [PATCH 2/2] staging: wlan-ng: remove else statement Archana
  2023-03-11  7:40 ` [PATCH 1/2] staging: wlan-ng: remove unnecessary kfree statements Greg KH
  0 siblings, 2 replies; 12+ messages in thread
From: Archana @ 2023-03-10 20:59 UTC (permalink / raw)
  To: drv, linux-staging, gregkh; +Cc: Archana

The function uses goto free_result in rest of its implementation.

Signed-off-by: Archana <craechal@gmail.com>
---
 drivers/staging/wlan-ng/prism2fw.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/wlan-ng/prism2fw.c b/drivers/staging/wlan-ng/prism2fw.c
index 02a2191d5c4d..98ed9bb9192c 100644
--- a/drivers/staging/wlan-ng/prism2fw.c
+++ b/drivers/staging/wlan-ng/prism2fw.c
@@ -1008,12 +1008,11 @@ static int writeimage(struct wlandevice *wlandev, struct imgchunk *fchunk,
 	rstmsg = kzalloc(sizeof(*rstmsg), GFP_KERNEL);
 	rwrmsg = kzalloc(sizeof(*rwrmsg), GFP_KERNEL);
 	if (!rstmsg || !rwrmsg) {
-		kfree(rstmsg);
-		kfree(rwrmsg);
 		netdev_err(wlandev->netdev,
 			   "%s: no memory for firmware download, aborting download\n",
 			   __func__);
-		return -ENOMEM;
+		result = -ENOMEM;
+		goto free_result;
 	}
 
 	/* Initialize the messages */
-- 
2.34.1


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

end of thread, other threads:[~2023-03-16 11:27 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-10 20:59 [PATCH 1/2] staging: wlan-ng: remove unnecessary kfree statements Archana
2023-03-10 20:59 ` [PATCH 2/2] staging: wlan-ng: remove else statement Archana
2023-03-11  4:34   ` Dan Carpenter
2023-03-11  4:58     ` Dan Carpenter
2023-03-11  7:39       ` Greg KH
2023-03-11 12:12         ` [PATCH v2 1/2] staging: wlan-ng: small cleanup in writeimage() Archana
2023-03-11 12:12           ` [PATCH v2 2/2] staging: wlan-ng: small cleanup in plugimage() Archana
2023-03-11 12:37           ` [PATCH v2 1/2] staging: wlan-ng: small cleanup in writeimage() Dan Carpenter
2023-03-11 12:45         ` [PATCH 2/2] staging: wlan-ng: remove else statement Archana
2023-03-11  7:40 ` [PATCH 1/2] staging: wlan-ng: remove unnecessary kfree statements Greg KH
2023-03-16 11:19   ` Archana
2023-03-16 11:27   ` Archana

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.