If you deref a NULL pointer, you trigger a WARN. It seems highly
excessive to trigger a panic (BUG) if we leak a child slice. So turn the
BUG into a WARN and add one more to be consistent with
kdbus_pool_slice_release().
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
if (child) {
/* Only allow one level of recursion */
- BUG_ON(child->child);
+ WARN_ON(child->child);
+ WARN_ON(!child->ref_kernel);
child->ref_kernel = false;
__kdbus_pool_slice_release(child);
}