Received: by 2002:ac2:464d:0:0:0:0:0 with SMTP id s13csp3669621lfo; Mon, 23 May 2022 10:54:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzEvTI+gZGHsp78b9cHPXDZuRjd/I6o49XZ6ZDvtD9Smn1Sz13nlxmyGyNSUArIVAu977GJ X-Received: by 2002:a17:902:c2c1:b0:162:3a9:2819 with SMTP id c1-20020a170902c2c100b0016203a92819mr12849038pla.38.1653328489597; Mon, 23 May 2022 10:54:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653328489; cv=none; d=google.com; s=arc-20160816; b=StbqjS4tZeHMEJItEjfPThJdt+stbheIdl9ZriWMBcBgoBpJw8cJb4lq0J11bsoxk8 noP0RRNPV5mxaraerf53g0YGJKUmFgv9Nniue9dDg7iCDY+r8eWyjN4j5RJ2vKvv4dEu ddKPkuQFyhBMhxwxxnhNwfr7TpqA0qXxdFgIvzM4d3Gp2lkpnyGUBxDvtjPvCbILaLSe 1yBmfFFkbu0ZH8ah8JomZnR+VDAda+ybTgD7/BuQrtb+MXCV9vDgi0NRZv13Huha8ydB ab5cleflVXLEuEVk67GYi09q+gXucL+h8iBA24CwAh4YKz9dtH4KyaWA53PryrHu7hoa sjeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=li0Tg7u0gsa6jw5TSt5RxPtPFKQZdeuIblB/9IcEnug=; b=SG82GF2hpVOYIG3RBTXzBaXu+wNxZE9+OABzM04eBhzu4DXcBPBogpk0BtK7KaXSG1 TLOmL9SvkqAo0hzUlKEY6c/+c4D4zQYukEOr8CWk2MAZ+DEqLy7lfCf6jETjVGRTGbHQ WYiDXZq96888pCW3y4Ij+TGd03CEjFBQr9LmdsKZ7kc9tHScT8x+lbTPvYpgkHOZTmVZ 65a1L28LMt+j2KisEpywqpHBz59XjREP/Ibb1dTHlYR5uRmixObPOZU1j4YJDCnJmCrB 1IdMbU6rZmygJs+g8K1Ro5/waRuQv1Rc6p4ui0nCQCbUunYA3QlYJ+MSuTezALTMtkFi HbpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=sX1LJoZw; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id a13-20020a631a0d000000b003f8a48ee49asi10886393pga.97.2022.05.23.10.54.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 10:54:49 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=sX1LJoZw; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 672D5B0A45; Mon, 23 May 2022 10:53:27 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240881AbiEWRsx (ORCPT + 99 others); Mon, 23 May 2022 13:48:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37298 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239982AbiEWR2T (ORCPT ); Mon, 23 May 2022 13:28:19 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CF81185ED4; Mon, 23 May 2022 10:25:29 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id CB3E760B35; Mon, 23 May 2022 17:24:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C9A50C385A9; Mon, 23 May 2022 17:24:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1653326663; bh=9TYJYF+vIYn4Rauou50K/Dlok5Da5u2dcSEtn1x3pCU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sX1LJoZwNZHRLiKnRdbdwI6wgmZdpAB8Y/lNE/ONMT1NeiYJkHSr70ymaqvyb4hPr i+l9kVqEz3Eqvghkw6+4cWWJpWJ1ZXJN+YWvVoIxkDoey07oae1fHw8+O/DojjWXaL 2yM3ZzU+wA1LTNkvjoFq0C5MnqZdchrPbPfhldW8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, David Laight , Masahiro Yamada , Sasha Levin Subject: [PATCH 5.17 021/158] kconfig: add fflush() before ferror() check Date: Mon, 23 May 2022 19:02:58 +0200 Message-Id: <20220523165834.123495216@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220523165830.581652127@linuxfoundation.org> References: <20220523165830.581652127@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Masahiro Yamada [ Upstream commit 868653f421cd37e8ec3880da19f0aac93f5c46cc ] As David Laight pointed out, there is not much point in calling ferror() unless you call fflush() first. Reported-by: David Laight Signed-off-by: Masahiro Yamada Signed-off-by: Sasha Levin --- scripts/kconfig/confdata.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c index d3c3a61308ad..94dcec2cc803 100644 --- a/scripts/kconfig/confdata.c +++ b/scripts/kconfig/confdata.c @@ -979,6 +979,7 @@ static int conf_write_autoconf_cmd(const char *autoconf_name) fprintf(out, "\n$(deps_config): ;\n"); + fflush(out); ret = ferror(out); /* error check for all fprintf() calls */ fclose(out); if (ret) @@ -1097,6 +1098,7 @@ static int __conf_write_autoconf(const char *filename, if ((sym->flags & SYMBOL_WRITE) && sym->name) print_symbol(file, sym); + fflush(file); /* check possible errors in conf_write_heading() and print_symbol() */ ret = ferror(file); fclose(file); -- 2.35.1