Commit 64ff013c authored by Russell King (Oracle)'s avatar Russell King (Oracle) Committed by Kalle Valo

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: default avatarRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Signed-off-by: default avatarKalle Valo <kvalo@kernel.org>
Link: https://msgid.link/E1sBsxi-00E8vQ-5r@rmk-PC.armlinux.org.uk
parent a2ead344
...@@ -83,7 +83,7 @@ int wlcore_event_fw_logger(struct wl1271 *wl) ...@@ -83,7 +83,7 @@ int wlcore_event_fw_logger(struct wl1271 *wl)
/* Copy initial part up to the end of ring buffer */ /* Copy initial part up to the end of ring buffer */
len = min(actual_len, available_len); len = min(actual_len, available_len);
wl12xx_copy_fwlog(wl, &buffer[start_loc], 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) if (clear_ptr == buff_end_ptr)
clear_ptr = buff_start_ptr; clear_ptr = buff_start_ptr;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment