Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp3713014pxb; Mon, 21 Feb 2022 04:20:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJzu2jfEC3lrvlv9xwufgjLF+zx29/T7nzq8Y/bbh7BYOrewpNki5o0342AivTJmv0a9SITp X-Received: by 2002:a17:902:dac1:b0:14d:c0f7:3227 with SMTP id q1-20020a170902dac100b0014dc0f73227mr18503520plx.70.1645446032135; Mon, 21 Feb 2022 04:20:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645446032; cv=none; d=google.com; s=arc-20160816; b=M2bWhELVdEjBynSkxuKt74IQ3johfFKYSqd6Rnk6YzISrCX1QoopanN/zHpYAzAylI 3UmagY+UgXcMOd1ZDYPVbAObDrDFnwlK80TSM5hio0NiJpmvdDvhCFGDgKcatPxTlKyV yAnQfQRLM6txvdixTItFSyktmEOKt0Lcjax4p5CxGcptZY0CWst+/AHRgz9+958xZ1li H7f1PdhIKX4/jZdRrLeLZhV46hEEPC5qV/SdnnCbofmUUXragt4H35AXy9D8ISpIQAXK djNAAmATBN54/C8Q2/5nVptbQs0Fk2awxKT+Jk8MitBHW5NaISjQFwafzjVnafq16/Xv ibOA== 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=vzQPxeD0QB+p4WuM6HABWStZ6LvUliT0VyXiQ6Dk5pk=; b=oNAtvydyOSxIn8DzGx8qooSjpDmGhfFppdphihsFh6WkACkr6s3t9OzztZqa1H8hyj Hz7fYNb5RBaSC01L5+3DDNWUcPcBqNcDmDh9cygltxD0+BQHeJ2zXb7MxDmBdPPMFvpb G+jLzIgfewHp2wJw9pVeXuMeONIe7PoO1klxv2Y41xl+/unzcpfyKWy+yai/zEni3/Yi 4xHThvhhCQa9S2wzbus28/tSPukEzlhjHzBjCj+RYGImM4mBibn5tdB/kGI1JB4L6MCZ t0vGmCMSxWD2x787qJVi/rMXf4nomGEZJbvab228xbfyeQlgECD7PsuG766H/B6QP00M 5qNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=mFQpi4tO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id na15si6761968pjb.49.2022.02.21.04.20.18; Mon, 21 Feb 2022 04:20:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=mFQpi4tO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347978AbiBUJNf (ORCPT + 99 others); Mon, 21 Feb 2022 04:13:35 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:36372 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347839AbiBUJI7 (ORCPT ); Mon, 21 Feb 2022 04:08:59 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D191B1F5; Mon, 21 Feb 2022 01:01:07 -0800 (PST) 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 6FA1A611F4; Mon, 21 Feb 2022 09:01:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 47CA0C340EB; Mon, 21 Feb 2022 09:01:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1645434066; bh=3iJNsLs5igWnW9tIYI/say2ztI8UpVKT9KjMYdP1aAU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mFQpi4tOp9bU37mz3KFzovlC4nM1SKqI/y8Pu/2mB65ErewqIoBXSHQ18RkjmFQiQ ncSRsEFChe6Eqs1kBqHIKcgQvXkO3jxyNVl/siWy/KcCoTSpTx0sAgS2oXl/LdVAxO EdYsh3fK2udG+fbXy/qxtIivJvPgoHL6JCVJL2hc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jing Leng , Masahiro Yamada , Sasha Levin Subject: [PATCH 5.4 80/80] kconfig: fix failing to generate auto.conf Date: Mon, 21 Feb 2022 09:50:00 +0100 Message-Id: <20220221084918.211979289@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220221084915.554151737@linuxfoundation.org> References: <20220221084915.554151737@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=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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: Jing Leng [ Upstream commit 1b9e740a81f91ae338b29ed70455719804957b80 ] When the KCONFIG_AUTOCONFIG is specified (e.g. export \ KCONFIG_AUTOCONFIG=output/config/auto.conf), the directory of include/config/ will not be created, so kconfig can't create deps files in it and auto.conf can't be generated. Signed-off-by: Jing Leng Signed-off-by: Masahiro Yamada Signed-off-by: Sasha Levin --- scripts/kconfig/confdata.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c index 17298239e3633..5c2493c8e9de8 100644 --- a/scripts/kconfig/confdata.c +++ b/scripts/kconfig/confdata.c @@ -987,14 +987,19 @@ static int conf_write_dep(const char *name) static int conf_touch_deps(void) { - const char *name; + const char *name, *tmp; struct symbol *sym; int res, i; - strcpy(depfile_path, "include/config/"); - depfile_prefix_len = strlen(depfile_path); - name = conf_get_autoconfig_name(); + tmp = strrchr(name, '/'); + depfile_prefix_len = tmp ? tmp - name + 1 : 0; + if (depfile_prefix_len + 1 > sizeof(depfile_path)) + return -1; + + strncpy(depfile_path, name, depfile_prefix_len); + depfile_path[depfile_prefix_len] = 0; + conf_read_simple(name, S_DEF_AUTO); sym_calc_value(modules_sym); -- 2.34.1