RISC-V: fix strncmp for shorter 2nd strings
From: Heiko Stuebner <heiko.stuebner@...> Date: Thu, 23 Feb 2023 12:04:19 +0100
Commit-Message
The strncmp implementation didn't handle the case correctly when the second string was a lot shorter than the first one, so the 0-byte detection didn't trigger for the 1st string. To fix this look for 0-bytes in each block of the second string as well and jump to the tail processing in that case, similar to how its done for the first string. Reported-by: Reported-by: Guenter Roeck <linux@...> Fixes: b6fcdb191e36 ("RISC-V: add zbb support to string functions") Signed-off-by: Heiko Stuebner <heiko.stuebner@...>
Patch-Comment
arch/riscv/lib/strncmp.S | 2 ++ 1 file changed, 2 insertions(+)
Statistics
- 2 lines added
- 0 lines removed