summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Snitzer <snitzer@redhat.com>2014-03-21 15:54:03 -0400
committerSascha Hauer <s.hauer@pengutronix.de>2014-09-11 15:53:26 +0200
commit6503dd7370427100d1b9537b90c2d934e0c965d8 (patch)
tree55981ebbe7f1a74d4de662e46d22ec548cf868b0
parentc457880e0d2ce146ea21e2cfa92537b6dd41b8e7 (diff)
downloadbarebox-6503dd7370427100d1b9537b90c2d934e0c965d8.tar.gz
barebox-6503dd7370427100d1b9537b90c2d934e0c965d8.tar.xz
UBI: fix rb_tree node comparison in add_map
The comparisons used in add_vol() shouldn't be identical. Pretty sure the following is correct but it is completely untested. Signed-off-by: Mike Snitzer <snitzer@redhat.com> Acked-by: Richard Weinberger <richard@nod.at> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
-rw-r--r--drivers/mtd/ubi/fastmap.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/mtd/ubi/fastmap.c b/drivers/mtd/ubi/fastmap.c
index 50db66140..3aa7aa817 100644
--- a/drivers/mtd/ubi/fastmap.c
+++ b/drivers/mtd/ubi/fastmap.c
@@ -125,9 +125,9 @@ static struct ubi_ainf_volume *add_vol(struct ubi_attach_info *ai, int vol_id,
parent = *p;
av = rb_entry(parent, struct ubi_ainf_volume, rb);
- if (vol_id > av->vol_id)
+ if (vol_id < av->vol_id)
p = &(*p)->rb_left;
- else if (vol_id > av->vol_id)
+ else
p = &(*p)->rb_right;
}