IB/mad: Issue complete whenever decrements agent refcount
authorShay Drory <shayd@mellanox.com>
Sun, 21 Jun 2020 10:47:36 +0000 (13:47 +0300)
committerJason Gunthorpe <jgg@nvidia.com>
Wed, 24 Jun 2020 19:43:44 +0000 (16:43 -0300)
commitb9af0e2d5aeab77bef33bd3df073c3c96b69ec79
treebcea9450fcd3a3b1e026a0fb3984a87ee27b441c
parent95a5631f6c9f3045f26245e6045244652204dfdb
IB/mad: Issue complete whenever decrements agent refcount

Replace calls of atomic_dec() to mad_agent_priv->refcount with calls to
deref_mad_agent() in order to issue complete. Most likely the refcount is
> 1 at these points, but it is difficult to prove. Performance is not
important on these paths, so be obviously correct.

Link: https://lore.kernel.org/r/20200621104738.54850-3-leon@kernel.org
Signed-off-by: Shay Drory <shayd@mellanox.com>
Reviewed-by: Maor Gottlieb <maorg@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/core/mad.c