mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2024-12-29 09:13:38 +00:00
lib: objagg: Fix an error code in objagg_hints_get()
We need to set the error code on this path otherwise we return
ERR_PTR(0) which would result in a NULL dereference in the caller.
Fixes: 9069a3817d
("lib: objagg: implement optimization hints assembly and use hints for object creation")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
f8b1f9f645
commit
4446eb8dbe
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user