gpu: ion: Fix bug in ion_buffer_add
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
diff --git a/drivers/gpu/ion/ion.c b/drivers/gpu/ion/ion.c
index 108469b..1d65d79 100644
--- a/drivers/gpu/ion/ion.c
+++ b/drivers/gpu/ion/ion.c
@@ -116,13 +116,14 @@
parent = *p;
entry = rb_entry(parent, struct ion_buffer, node);
- if (buffer < entry)
+ if (buffer < entry) {
p = &(*p)->rb_left;
- else if (buffer > entry)
+ } else if (buffer > entry) {
p = &(*p)->rb_right;
- else
+ } else {
pr_err("%s: buffer already found.", __func__);
BUG();
+ }
}
rb_link_node(&buffer->node, parent, p);