Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2662319pxj; Mon, 14 Jun 2021 04:19:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzcH9rqonGQYF6S7s7FnPEpRr8zPa4CMtW8dLq/mj5y+k9B8/Pjzf2kACysoxSuGt7sv6P2 X-Received: by 2002:a17:906:b352:: with SMTP id cd18mr14326739ejb.222.1623669590667; Mon, 14 Jun 2021 04:19:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623669590; cv=none; d=google.com; s=arc-20160816; b=sHTtGVM03DuY4J0daqA8MVmDoP1+AlpsGuZt0Y5UF45DmoZLwAnmObMYwTfe99zifQ iKgCtZCR8hjzgzgDXL2jFTxoQWQgBh4/V4MtnKX8ZGUgQSGTP8wghuil7PtLAbgmzlCR 485zLBDdLg/b6e0DVO9TWDBYS9rVlnnBd9JcJtlM3PuFqaqL9Lv0r+uj+AiKU+9o43iI jdYx2Oelit0/Qpgew6QKV2dgkKpx96Vqkm6WNehdF/3Cg+R+BReau1OPbz5D9L4oCX/w Id0+MCIKfcHfpwK/8PM7m7uBHtIF+ao6OT9sogRmYaw2zVpuTpx9Z0wZU/WlUsgn5HxK wF9w== 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=mrPtXYYbLsT2uq9daskyMwYMBLw9uZxOYehy9yg+r80=; b=nz++Surg4NOZIu1Dh6qWYCwFOUcovYb+hp0+SSEXv2be8Z59f0SJsoYG/Pmu0kUfTd SqV2TOPZ2hQXVObhqBX12cmTbDICGzef3nGiEgiKLfZxAwnMJXpOf8pebbGpNNJywDyp QUB+YjU4UwDhz8cPnjyCIeVMA5447ixnZw4B3s1pt2Avql/nYWXgb6nZJMCchoy8zo3H w85FfbSSVj0ry4JweRYwUfwcCEn3ipBwSpdyYd9qqpPxEiVtrv9ulHmN67su7Wz8CpF9 /nDFAYz+/Y6b98Km717AMq4VAv2Eyv+oq0Nws4XfPT/XHQsZTGc6/xYPhuo6kYrftSnq c0Yw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=iJpKvXeg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g25si10837704eds.466.2021.06.14.04.19.27; Mon, 14 Jun 2021 04:19:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=iJpKvXeg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S235684AbhFNLTP (ORCPT + 99 others); Mon, 14 Jun 2021 07:19:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:39160 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235275AbhFNLHH (ORCPT ); Mon, 14 Jun 2021 07:07:07 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 26B0661927; Mon, 14 Jun 2021 10:45:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1623667534; bh=BowvD/eSCy3QX3Vc3LZAqN1yb6cnkXLJ8emSXKqQH6E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iJpKvXegYwxuLxMM8wlypnGq7Aha06QneTAu7OKMeeHHeIhqre1xUW+u0bBhMxR/D gn/8FxqGY8rG3mSxkEP2Qn0AgPF6rEzxjQcs4654Mkr4hdovOMnlMrWVXYcvhCKXT8 LiGM5qvbtYibRvBK2IP4rp3NxV4HecFYgnVjLpfU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hulk Robot , Masami Hiramatsu , Zhen Lei , "Steven Rostedt (VMware)" Subject: [PATCH 5.10 107/131] tools/bootconfig: Fix error return code in apply_xbc() Date: Mon, 14 Jun 2021 12:27:48 +0200 Message-Id: <20210614102656.640062962@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210614102652.964395392@linuxfoundation.org> References: <20210614102652.964395392@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Zhen Lei commit e8ba0b2b64126381643bb50df3556b139a60545a upstream. Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Link: https://lkml.kernel.org/r/20210508034216.2277-1-thunder.leizhen@huawei.com Fixes: a995e6bc0524 ("tools/bootconfig: Fix to check the write failure correctly") Reported-by: Hulk Robot Acked-by: Masami Hiramatsu Signed-off-by: Zhen Lei Signed-off-by: Steven Rostedt (VMware) Signed-off-by: Greg Kroah-Hartman --- tools/bootconfig/main.c | 1 + 1 file changed, 1 insertion(+) --- a/tools/bootconfig/main.c +++ b/tools/bootconfig/main.c @@ -399,6 +399,7 @@ static int apply_xbc(const char *path, c } /* TODO: Ensure the @path is initramfs/initrd image */ if (fstat(fd, &stat) < 0) { + ret = -errno; pr_err("Failed to get the size of %s\n", path); goto out; }