Make sure returned value is checked and assert a valid refcount.
While at it fix a print: Unsigned types cannot be negative.
MFC after: 1 week
Sponsored by: Mellanox Technologies
Differential D17616
Add missing function attributes and assert for refcount_acquire_if_not_zero() and refcount_acquire_if_not_last() • hselasky on Oct 19 2018, 1:35 PM. Authored by Tags None Referenced Files
Details Make sure returned value is checked and assert a valid refcount. MFC after: 1 week
Diff Detail
Event Timeline
Comment Actions I think the return value of refcount_release() should also be checked, but I see many users in the kernel which don't check it. Comment Actions So both you and mjg mentioned that there are a lot of consumers which do not check the result from release_if_not_last. How is it handled ?
Comment Actions @kib : Only refcount_release() can be called w/o checking the returned result, so I didn't add an attribute for that function. The others should be fine from what I can see.
|