On Wed, Sep 02, 2020 at 11:17:08AM +0300, Leon Romanovsky wrote: > From: Jason Gunthorpe <jgg@xxxxxxxxxx> > > Currently it triggers a WARN_ON and then goes ahead and destroys the > uobject anyhow, leaking any driver memory. > > The only place that leaks driver memory should be during FD close() in > uverbs_destroy_ufile_hw(). > > Drivers are only allowed to fail destroy uobjects if they guarentee > destroy will eventually succeed. uverbs_destroy_ufile_hw() provides the > loop to give the driver that chance. > > Signed-off-by: Jason Gunthorpe <jgg@xxxxxxxxxx> > Signed-off-by: Leon Romanovsky <leonro@xxxxxxxxxx> > --- > drivers/infiniband/core/rdma_core.c | 30 ++++++++++++++--------------- > include/rdma/ib_verbs.h | 5 ----- > 2 files changed, 15 insertions(+), 20 deletions(-) Applied to for-next Jason