]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit729521e5a7fbb35fa2427a04e487d13b2e681a25
tree8518fc3aa981b96dad1c2b4a2060da0075819820
parent34d283551cbc7307ed7e300a58897088cfc89554
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: f8ebf29b928f ("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