gpu: ion: Fix bug in ion_buffer_add
Rebecca Schultz Zavin [Fri, 1 Jul 2011 01:09:05 +0000 (18:09 -0700)]
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>

drivers/gpu/ion/ion.c

index 108469b..1d65d79 100644 (file)
@@ -116,13 +116,14 @@ static void ion_buffer_add(struct ion_device *dev,
                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);