Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752208AbcLCKz5 (ORCPT ); Sat, 3 Dec 2016 05:55:57 -0500 Received: from m50-133.163.com ([123.125.50.133]:39600 "EHLO m50-133.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750912AbcLCKz4 (ORCPT ); Sat, 3 Dec 2016 05:55:56 -0500 From: Pan Bian To: Chris Mason , Josef Bacik , David Sterba , linux-btrfs@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Pan Bian Subject: [PATCH 1/1] btrfs: fix improper return value Date: Sat, 3 Dec 2016 18:55:16 +0800 Message-Id: <1480762516-5002-1-git-send-email-bianpan2016@163.com> X-Mailer: git-send-email 1.9.1 X-CM-TRANSID: DdGowADHYKiTpEJYUTc0Iw--.23025S3 X-Coremail-Antispam: 1Uf129KBjvdXoW7Jr4fZFy7Ww17Kr4UKr4kZwb_yoW3Jwb_GF yxA3y8KF4rJw1kWr1rGrWSqFWag340gryvqa45GFZxKw17Kan8ZFs2grs0k3s5Za1aqFy5 GFZaqa4UC3W7GjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IU5zwZ5UUUUU== X-Originating-IP: [222.131.246.88] X-CM-SenderInfo: held01tdqsiiqw6rljoofrz/xtbBzxY1claDscc1lgAAse Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 700 Lines: 25 In function btrfs_uuid_tree_iterate(), errno is assigned to variable ret on errors. However, it directly returns 0. It may be better to return ret. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=188731 Signed-off-by: Pan Bian --- fs/btrfs/uuid-tree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/btrfs/uuid-tree.c b/fs/btrfs/uuid-tree.c index 7fc89e4..44bcc1f 100644 --- a/fs/btrfs/uuid-tree.c +++ b/fs/btrfs/uuid-tree.c @@ -353,5 +353,5 @@ int btrfs_uuid_tree_iterate(struct btrfs_fs_info *fs_info, btrfs_free_path(path); if (ret) btrfs_warn(fs_info, "btrfs_uuid_tree_iterate failed %d", ret); - return 0; + return ret; } -- 1.9.1