Skip to contentSkip to conversation

lib/tst_kvercmp.c: Update tst_parse_kver() condition

PATCH In review Egor Petrov 3 participants 3 messages Oct 28, 2021 – Oct 29, 2021 Library code

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lib/tst_kvercmp.c: Update tst_parse_kver() condition

tst_parse_kver() fails with kernel names like current mainline kernel "5.15-rc7". Updated condition to fit this template.

---
 lib/tst_kvercmp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/tst_kvercmp.c +1 -1
index 8bf65d309..dc0daa746 100644
@@ -65,7 +65,7 @@ int tst_parse_kver(const char *str_kver, int *v1, int *v2, int *v3)
 	/*
 	 * Check for a short version e.g '2.4'
 	 */
-	if (*str == ' ' || *str == '\0')
+	if (*str == ' ' || *str == '\0' || *str == '-')
 		return 0;
 
 	if (*(str++) != '.')
Signature · 5 lines
2.32.0.windows.2


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
Reviewed-by on v1 1/1
#1 lore raw

Hi Egor,

Quoted 3 lines

tst_parse_kver() fails with kernel names like current mainline kernel "5.15-rc7". Updated condition to fit this template.

Kind regards,
Petr

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp