IB/uverbs: Fix race between uverbs_close and remove_one
[cascardo/linux.git] / drivers / infiniband / core / uverbs.h
index 612ccfd..9245e55 100644 (file)
@@ -116,6 +116,7 @@ struct ib_uverbs_event_file {
 struct ib_uverbs_file {
        struct kref                             ref;
        struct mutex                            mutex;
+       struct mutex                            cleanup_mutex; /* protect cleanup */
        struct ib_uverbs_device                *device;
        struct ib_ucontext                     *ucontext;
        struct ib_event_handler                 event_handler;