diff mbox series

[wireless-next,1/8] wifi: wlcore: correctness fix fwlog reading

Message ID E1sBsxi-00E8vQ-5r@rmk-PC.armlinux.org.uk (mailing list archive)
State Accepted
Commit 64ff013ce0986952fad1678d7faf8998584fc500
Delegated to: Kalle Valo
Headers show
Series wifi: TI wilink8 updates | expand

Commit Message

Russell King (Oracle) May 28, 2024, 9:17 a.m. UTC
Fix the calculation of clear_offset, which may overflow the end of
the buffer. However, this is harmless if it does because in that case
it will be recalculated when we copy the chunk of messages at the
start of the buffer.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
---
 drivers/net/wireless/ti/wlcore/event.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Kalle Valo June 18, 2024, 10:22 a.m. UTC | #1
"Russell King (Oracle)" <rmk+kernel@armlinux.org.uk> wrote:

> Fix the calculation of clear_offset, which may overflow the end of
> the buffer. However, this is harmless if it does because in that case
> it will be recalculated when we copy the chunk of messages at the
> start of the buffer.
> 
> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>

8 patches applied to wireless-next.git, thanks.

64ff013ce098 wifi: wlcore: correctness fix fwlog reading
b734d8830f70 wifi: wl18xx: make wl18xx_tx_immediate_complete() more efficient
97715e29cebc wifi: wlcore: improve code in wlcore_fw_status()
dd265a7415f8 wifi: wlcore: pass "status" to wlcore_hw_convert_fw_status()
81271c2bc59e wifi: wlcore: store AP encryption key type
bb8edd900fd6 wifi: wlcore: add pn16 support
9685262b5e5d wifi: wl18xx: add support for reading 8.9.1 fw status
8c58f972219e wifi: wl18xx: allow firmwares > 8.9.0.x.58
diff mbox series

Patch

diff --git a/drivers/net/wireless/ti/wlcore/event.c b/drivers/net/wireless/ti/wlcore/event.c
index 2499dc908305..6c3a8ea9613e 100644
--- a/drivers/net/wireless/ti/wlcore/event.c
+++ b/drivers/net/wireless/ti/wlcore/event.c
@@ -83,7 +83,7 @@  int wlcore_event_fw_logger(struct wl1271 *wl)
 	/* Copy initial part up to the end of ring buffer */
 	len = min(actual_len, available_len);
 	wl12xx_copy_fwlog(wl, &buffer[start_loc], len);
-	clear_ptr = addr_ptr + start_loc + actual_len;
+	clear_ptr = addr_ptr + start_loc + len;
 	if (clear_ptr == buff_end_ptr)
 		clear_ptr = buff_start_ptr;