From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 68874C2D0DB for ; Tue, 28 Jan 2020 14:13:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2C17B24698 for ; Tue, 28 Jan 2020 14:13:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580220813; bh=EoCZegduvs6m+jj4UlGAqFHpvD2Z3fCOya/GVTD5pG4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=Cpc3KWw+0BxT9Qr0SV7bAkaaipzTxhlaxa3LsYHZKsGjlXWp5GBh38s7rYX/22urk OzSBN6v1Io+CXVf20qAz+iIO6/HKW5oS1WOH15P+2v1AqFNU0L/2LA8BoO3E0dr0wU blRdhvKdaPpL3m9RhBMKxloChxKZWnDe0PEM1UK8= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729388AbgA1ONc (ORCPT ); Tue, 28 Jan 2020 09:13:32 -0500 Received: from mail.kernel.org ([198.145.29.99]:35098 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727949AbgA1ON3 (ORCPT ); Tue, 28 Jan 2020 09:13:29 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3A5922468F; Tue, 28 Jan 2020 14:13:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580220808; bh=EoCZegduvs6m+jj4UlGAqFHpvD2Z3fCOya/GVTD5pG4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wtRoAHGF2L4+pJK5BtbBhYVDQqFUA/J6d68zQN2YmnZZMXlmrUcCG1+aSp8CyZPaP AQnEHsGMfaZ41be6+g4dVzuWxnBxfm3G6g9AtmpvAZDahnTtgS4IdP1caSIDce8Ffu 1ALGQOMiXoGl7MGDvl7flkglj1hk8OJyLPlrSO8Q= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Colin Ian King , Theodore Tso , Sasha Levin Subject: [PATCH 4.4 119/183] ext4: set error return correctly when ext4_htree_store_dirent fails Date: Tue, 28 Jan 2020 15:05:38 +0100 Message-Id: <20200128135841.833220521@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200128135829.486060649@linuxfoundation.org> References: <20200128135829.486060649@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Colin Ian King [ Upstream commit 7a14826ede1d714f0bb56de8167c0e519041eeda ] Currently when the call to ext4_htree_store_dirent fails the error return variable 'ret' is is not being set to the error code and variable count is instead, hence the error code is not being returned. Fix this by assigning ret to the error return code. Addresses-Coverity: ("Unused value") Fixes: 8af0f0822797 ("ext4: fix readdir error in the case of inline_data+dir_index") Signed-off-by: Colin Ian King Signed-off-by: Theodore Ts'o Signed-off-by: Sasha Levin --- fs/ext4/inline.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ext4/inline.c b/fs/ext4/inline.c index 0dcd33f626376..00f9433eea23a 100644 --- a/fs/ext4/inline.c +++ b/fs/ext4/inline.c @@ -1418,7 +1418,7 @@ int htree_inlinedir_to_tree(struct file *dir_file, err = ext4_htree_store_dirent(dir_file, hinfo->hash, hinfo->minor_hash, de, &tmp_str); if (err) { - count = err; + ret = err; goto out; } count++; -- 2.20.1