On 3/17/2016 6:48 PM, Jason Gunthorpe wrote: > + if (file->ucontext) { > + file->ucontext = NULL; > + mutex_unlock(&file->cleanup_mutex); > + ib_dev->disassociate_ucontext(file->ucontext); > + ib_uverbs_cleanup_ucontext(file, file->ucontext); > } The general locking scheme sounds good to me, but obviously you need to keep the original value of file->ucontext before clearing it. -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html