From patchwork Mon Jun 14 10:27:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "gregkh@linuxfoundation.org" X-Patchwork-Id: 459818 Delivered-To: patch@linaro.org Received: by 2002:a02:735a:0:0:0:0:0 with SMTP id a26csp3179510jae; Mon, 14 Jun 2021 04:09:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxirKssBFWuTO0hwvK1qOEG5qQA+fjm75eUviJKqw1ETnkWRrx5EIthIc3BOuzvn93NPrFl X-Received: by 2002:aa7:c6c8:: with SMTP id b8mr16459211eds.213.1623668960119; Mon, 14 Jun 2021 04:09:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623668960; cv=none; d=google.com; s=arc-20160816; b=tfThm6Tr1yYlg+bs3hEh8uBKuLDFIvOmmw7S8aNAT88D3UNIbOcI46w1g9gUoJYEVY Wqd8DulAygzl8oDU5oEXkB9F6KvJ9Ur3+jVgMyDSjkySOUHnzibHSIrIP2SeXyro9BEc OYvofL4iZFQ249Osp6Kjme+U3KOG8cqw5jFI/8S9qRKSAIQ3pd09p1/W5oGLKEQwB5Xe vUDxB2mtZTyvDnQ3Hm78AKdsUfYhCJ2zJWzvQFg1pEL7Nv5WCmDXm4KMOuKGkoTT2pN8 ecWPPsk9V+DWDBHslo5mjPYXvY/pEOU7iA83yl2GWtn846xpzvxNAHxtjnxtCgwpFrK1 uZlw== 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=dz+LfOdsP0Z2Ye5r6uJebOYmFE8Rgq4A0aPmmkrnI2OrROiqEC6ztBe3o1B73WKzLR NFf2gQXj4zkSDz99SeUjNHJqyVxI/eDE1K79zsexfuqV2OwkPXi91TtdCVXvnI7LINzv RAbr6aaQCh6ggiBa9AVCH3O8Bv04KuPsB4tlXcdkvM8N6wDxtbknsJWzVdi5TaNKw1wD kf7NZez1bllmD7fWntbOzz7o96P3MDFcf6tXtTLwmQGDaSsdhK4+SB5iulkbyXDTFPaO 9UKuzh1qoh50i6qIGIEQL4Q0L708XZU5rewJMClKxPNZuJ1/yocjYLoM8AuqjFFRX/K9 JSGQ== 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 stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-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 y4si574263edc.212.2021.06.14.04.09.19; Mon, 14 Jun 2021 04:09:20 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-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 stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-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 S234854AbhFNLJI (ORCPT + 12 others); Mon, 14 Jun 2021 07:09:08 -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 Precedence: bulk List-ID: X-Mailing-List: stable@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; }