summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/objagg.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/objagg.c b/lib/objagg.c
index 781f41c3c47d..d552ec9c60ed 100644
--- a/lib/objagg.c
+++ b/lib/objagg.c
@@ -968,8 +968,10 @@ struct objagg_hints *objagg_hints_get(struct objagg *objagg,
if (err)
goto err_fillup_hints;
- if (WARN_ON(objagg_hints->node_count != objagg->obj_count))
+ if (WARN_ON(objagg_hints->node_count != objagg->obj_count)) {
+ err = -EINVAL;
goto err_node_count_check;
+ }
return objagg_hints;