lkml.org 
[lkml]   [2020]   [Dec]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.4 309/453] kconfig: fix return value of do_error_if()
    Date
    From: Masahiro Yamada <masahiroy@kernel.org>

    [ Upstream commit 135b4957eac43af2aedf8e2a277b9540f33c2558 ]

    $(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>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    scripts/kconfig/preprocess.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    diff --git a/scripts/kconfig/preprocess.c b/scripts/kconfig/preprocess.c
    index 0243086fb1685..0590f86df6e40 100644
    --- a/scripts/kconfig/preprocess.c
    +++ b/scripts/kconfig/preprocess.c
    @@ -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[])
    --
    2.27.0


    \
     
     \ /
      Last update: 2020-12-28 14:55    [W:4.088 / U:1.196 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site