summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2015-10-13 15:52:06 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-10-17 21:49:48 -0700
commitff65212cc4698f532c452a14fdb94a3b1d1f283d (patch)
tree746e5a4456f6bbeed5f0d92fe20a4f49bbd1fc96 /drivers
parentedf5600870121f83a20157d102ad12211c226ee0 (diff)
misc: mic/scif: re-take a lock on error path
The caller expects that we take this lock again before returning otherwise it you get double unlocks and races. Fixes: ba612aa8b487 ('misc: mic: SCIF memory registration and unregistration') Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Sudeep Dutt <sudeep.dutt@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/misc/mic/scif/scif_rma.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/misc/mic/scif/scif_rma.c b/drivers/misc/mic/scif/scif_rma.c
index e2889967036a..980ef13b4cf6 100644
--- a/drivers/misc/mic/scif/scif_rma.c
+++ b/drivers/misc/mic/scif/scif_rma.c
@@ -680,6 +680,7 @@ int scif_unregister_window(struct scif_window *window)
}
} else {
/* Return ENXIO since unregistration is in progress */
+ mutex_lock(&ep->rma_info.rma_lock);
return -ENXIO;
}
retry: