lib: fix a possible NULL deference

Silences a warning generated by clang.
This commit is contained in:
Rafael Zalamena 2017-06-16 11:08:43 -03:00
parent 45926e5874
commit 8f942af902

View File

@ -222,6 +222,10 @@ rbe_remove_color(const struct rb_type *t, struct rb_tree *rbt,
{
struct rb_entry *tmp;
/* Silence clang possible NULL deference warning. */
if (parent == NULL)
return;
while ((rbe == NULL || RBE_COLOR(rbe) == RB_BLACK) &&
rbe != RBH_ROOT(rbt)) {
if (RBE_LEFT(parent) == rbe) {