lib: objagg: fix handling of object with 0 users when assembling hints
authorJiri Pirko <jiri@mellanox.com>
Thu, 14 Feb 2019 14:39:07 +0000 (15:39 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 14 Feb 2019 17:41:54 +0000 (12:41 -0500)
commitfa8ba2cba7f9c75b84f82d174658d959d25d4561
tree8518fc3aa981b96dad1c2b4a2060da0075819820
parente0c6d1d8591ffae75e1bcfd36fa9d411c29f9ef3
lib: objagg: fix handling of object with 0 users when assembling hints

It is possible that there might be an originally parent object with 0
direct users that is in hints no longer considered as parent. Then the
weight of this object is 0 and current code ignores him. That's why the
total amount of hint objects might be lower than for the original
objagg and WARN_ON is hit. Fix this be considering 0 weight valid.

Fixes: 9069a3817d82 ("lib: objagg: implement optimization hints assembly and use hints for object creation")
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
lib/objagg.c