All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ath11k: fix invalid memory access
@ 2019-06-20 18:56 Karthikeyan Periyasamy
  2019-06-24 10:54 ` Kalle Valo
  0 siblings, 1 reply; 3+ messages in thread
From: Karthikeyan Periyasamy @ 2019-06-20 18:56 UTC (permalink / raw)
  To: ath11k; +Cc: Karthikeyan Periyasamy

dp_reo_cache_flush_elem element get dynamically allocated with invalid size
which leads to the access of unallocated memory region or memory corruption.
Fix this bug by allocate with dp_reo_cache_flush_elem structure size.

Signed-off-by: Karthikeyan Periyasamy <periyasa@codeaurora.org>
---
 drivers/net/wireless/ath/ath11k/dp_rx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath11k/dp_rx.c b/drivers/net/wireless/ath/ath11k/dp_rx.c
index 7654f9a..c64beb5 100644
--- a/drivers/net/wireless/ath/ath11k/dp_rx.c
+++ b/drivers/net/wireless/ath/ath11k/dp_rx.c
@@ -568,7 +568,7 @@ static void ath11k_dp_rx_tid_del_func(struct ath11k_dp *dp, void *ctx,
 		return;
 	}
 
-	elem = kzalloc(sizeof(elem), GFP_ATOMIC);
+	elem = kzalloc(sizeof(*elem), GFP_ATOMIC);
 	if (!elem) {
 		ath11k_warn(ab, "failed to allocate memory for cache flush element\n");
 		goto free_desc;
-- 
1.9.1


_______________________________________________
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

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

end of thread, other threads:[~2019-06-24 11:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-06-20 18:56 [PATCH] ath11k: fix invalid memory access Karthikeyan Periyasamy
2019-06-24 10:54 ` Kalle Valo
2019-06-24 11:01   ` Kalle Valo

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.