ubifs: Fix cut and paste error on sb type comparisons
authorColin Ian King <colin.king@canonical.com>
Fri, 7 Apr 2017 23:22:03 +0000 (00:22 +0100)
committerRichard Weinberger <richard@nod.at>
Mon, 8 May 2017 18:48:41 +0000 (20:48 +0200)
The check for the bad node type of sb->type is checking sa->type
and not sb-type. This looks like a cut and paste error. Fix this.

Detected by PVS-Studio, warning: V581

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
fs/ubifs/debug.c

index 718b749fa11aa8901544a1e6925a7486bbb357f5..7cd8a7b95299c2b096c93d0d0fbfd7838f8dff2c 100644 (file)
@@ -2391,8 +2391,8 @@ int dbg_check_nondata_nodes_order(struct ubifs_info *c, struct list_head *head)
                        ubifs_dump_node(c, sa->node);
                        return -EINVAL;
                }
-               if (sa->type != UBIFS_INO_NODE && sa->type != UBIFS_DENT_NODE &&
-                   sa->type != UBIFS_XENT_NODE) {
+               if (sb->type != UBIFS_INO_NODE && sb->type != UBIFS_DENT_NODE &&
+                   sb->type != UBIFS_XENT_NODE) {
                        ubifs_err(c, "bad node type %d", sb->type);
                        ubifs_dump_node(c, sb->node);
                        return -EINVAL;