linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] drivers: staging: wilc1000: Check for errors before kfree
@ 2015-10-02 13:17 Chandra S Gorentla
  2015-10-02 13:17 ` [PATCH 2/3] drivers: staging: wilc1000: Remove ineffective code Chandra S Gorentla
  2015-10-02 13:39 ` [PATCH 1/3] drivers: staging: wilc1000: Check for errors before kfree Dan Carpenter
  0 siblings, 2 replies; 5+ messages in thread
From: Chandra S Gorentla @ 2015-10-02 13:17 UTC (permalink / raw)
  To: gregkh
  Cc: johnny.kim, rachel.kim, chris.park, linux-wireless, devel,
	linux-kernel, dan.carpenter, Chandra S Gorentla

During the clean-up of the function, it is need to check if
errors occurred, not the memory pointer.

Signed-off-by: Chandra S Gorentla <csgorentla@gmail.com>
---
 drivers/staging/wilc1000/wilc_msgqueue.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c b/drivers/staging/wilc1000/wilc_msgqueue.c
index d5ebd6d..1b73b63 100644
--- a/drivers/staging/wilc1000/wilc_msgqueue.c
+++ b/drivers/staging/wilc1000/wilc_msgqueue.c
@@ -105,7 +105,7 @@ int wilc_mq_send(WILC_MsgQueueHandle *pHandle,
 
 ERRORHANDLER:
 	/* error occured, free any allocations */
-	if (pstrMessage) {
+	if (result) {
 		kfree(pstrMessage->pvBuffer);
 		kfree(pstrMessage);
 	}
-- 
2.1.4


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

end of thread, other threads:[~2015-10-03  2:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-02 13:17 [PATCH 1/3] drivers: staging: wilc1000: Check for errors before kfree Chandra S Gorentla
2015-10-02 13:17 ` [PATCH 2/3] drivers: staging: wilc1000: Remove ineffective code Chandra S Gorentla
2015-10-02 13:17   ` [PATCH 3/3] drivers: staging: wilc1000: Do not return from function with lock is on Chandra S Gorentla
2015-10-02 13:39 ` [PATCH 1/3] drivers: staging: wilc1000: Check for errors before kfree Dan Carpenter
2015-10-03  2:11   ` Chandra Gorentla

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).