summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/ti/wlcore/event.c
diff options
context:
space:
mode:
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>2024-05-28 10:17:42 +0100
committerKalle Valo <kvalo@kernel.org>2024-06-18 13:22:10 +0300
commit64ff013ce0986952fad1678d7faf8998584fc500 (patch)
treebc9e1545de25531d9e60a83daea5c3b3b7f95f4d /drivers/net/wireless/ti/wlcore/event.c
parenta2ead3445a6317c5d2b53711cf9a98e54c395223 (diff)
wifi: wlcore: correctness fix fwlog reading
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> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://msgid.link/E1sBsxi-00E8vQ-5r@rmk-PC.armlinux.org.uk
Diffstat (limited to 'drivers/net/wireless/ti/wlcore/event.c')
-rw-r--r--drivers/net/wireless/ti/wlcore/event.c2
1 files changed, 1 insertions, 1 deletions
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;