mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] staging: wicl1000: fix dereference after free in wilc_wlan_cleanup()
@ 2015-09-22 10:24 Javier Martinez Canillas
  2015-09-22 12:16 ` Sudip Mukherjee
  0 siblings, 1 reply; 3+ messages in thread
From: Javier Martinez Canillas @ 2015-09-22 10:24 UTC (permalink / raw)
  To: linux-kernel
  Cc: Javier Martinez Canillas, devel, linux-wireless, Johnny Kim,
	Tony Cho, Leo Kim, Glen Lee, Greg Kroah-Hartman, Rachel Kim,
	Chris Park

The wilc_wlan_cleanup() function iterates over the list of transmission
buffers freeing all of them and then iterates over the receive buffers
list to free all of them as well.

But on the receive loop a pointer to struct txq_entry_t is dereferenced
instead of the pointer to a struct rxq_entry_t. This not only causes a
dereference to a pointer already freed but also leaks the memory in the
struct rxq_entry_t buffer.

Fixes: c5c77ba18ea6 ("staging: wilc1000: Add SDIO/SPI 802.11 driver")
Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>

---

 drivers/staging/wilc1000/wilc_wlan.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c
index 4c25179c2fec..c40f143b00b7 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -1746,7 +1746,7 @@ static void wilc_wlan_cleanup(void)
 		if (rqe == NULL)
 			break;
 #ifdef MEMORY_DYNAMIC
-		kfree(tqe->buffer);
+		kfree(rqe->buffer);
 #endif
 		kfree(rqe);
 	} while (1);
-- 
2.4.3


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

end of thread, other threads:[~2015-09-22 13:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-22 10:24 [PATCH] staging: wicl1000: fix dereference after free in wilc_wlan_cleanup() Javier Martinez Canillas
2015-09-22 12:16 ` Sudip Mukherjee
2015-09-22 13:04   ` Javier Martinez Canillas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®