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 A6AF4C2D0DB for ; Fri, 24 Jan 2020 11:28:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7322820718 for ; Fri, 24 Jan 2020 11:28:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579865326; bh=zmOC4M/Wl5ibF14B6bnHfbXoKU5KEmJxJ6MwADDoRQM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=fOCiW8U9JtSxO8+iZZgoSprfg0Y5vIQ/nF8qpVAKg81O9xH6dQQrg2GCs+Di6VTSS L0WdeU6+CXWA7tyxMfGPpr7NHnH7c2L3rodzw8KpxmrHzncKuFiqze5MMNjuYwkQlg nns/OkYAJMmaEVdkHmW08qrbb1s3v/m22lVO+mI4= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391720AbgAXL2p (ORCPT ); Fri, 24 Jan 2020 06:28:45 -0500 Received: from mail.kernel.org ([198.145.29.99]:44974 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391703AbgAXL2l (ORCPT ); Fri, 24 Jan 2020 06:28:41 -0500 Received: from localhost (ip-213-127-102-57.ip.prioritytelecom.net [213.127.102.57]) (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 091C6206D4; Fri, 24 Jan 2020 11:28:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579865320; bh=zmOC4M/Wl5ibF14B6bnHfbXoKU5KEmJxJ6MwADDoRQM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QckKBe3YBoLfYLEezR8QwPNnAnK1+arV68j8B48NZY8JrDixclQOvwbhZ25GXvHoe uSQp4YUs8Fl4p2stUM0yh743sCW3Tc/3iOeiGWkTneH/uFy1AmoEtVfv85gF66fzS4 1q+JXvIYztL94WP0ifkB60U1mLfcz1i8O2KVdRAs= 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.19 501/639] ext4: set error return correctly when ext4_htree_store_dirent fails Date: Fri, 24 Jan 2020 10:31:11 +0100 Message-Id: <20200124093151.547582834@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200124093047.008739095@linuxfoundation.org> References: <20200124093047.008739095@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 56f6e1782d5f7..4572cb0579518 100644 --- a/fs/ext4/inline.c +++ b/fs/ext4/inline.c @@ -1419,7 +1419,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