]> git.baikalelectronics.ru Git - kernel.git/commitdiff
kconfig: fix return value of do_error_if()
authorMasahiro Yamada <masahiroy@kernel.org>
Sat, 19 Dec 2020 18:18:42 +0000 (03:18 +0900)
committerMasahiro Yamada <masahiroy@kernel.org>
Mon, 21 Dec 2020 05:48:54 +0000 (14:48 +0900)
$(error-if,...) is expanded to an empty string. Currently, it relies on
eval_clause() returning xstrdup("") when all attempts for expansion fail,
but the correct implementation is to make do_error_if() return xstrdup("").

Fixes: 1d6272e6fe43 ("kconfig: add 'info', 'warning-if', and 'error-if' built-in functions")
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
scripts/kconfig/preprocess.c

index 0243086fb16854d9c7555b13f4ad3f3b2b96c456..0590f86df6e40cfd073100904f3ec5cfbe650f5f 100644 (file)
@@ -114,7 +114,7 @@ static char *do_error_if(int argc, char *argv[])
        if (!strcmp(argv[0], "y"))
                pperror("%s", argv[1]);
 
-       return NULL;
+       return xstrdup("");
 }
 
 static char *do_filename(int argc, char *argv[])