From ff65212cc4698f532c452a14fdb94a3b1d1f283d Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Tue, 13 Oct 2015 15:52:06 +0300 Subject: [PATCH] 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 Reviewed-by: Sudeep Dutt Signed-off-by: Greg Kroah-Hartman --- drivers/misc/mic/scif/scif_rma.c | 1 + 1 file changed, 1 insertion(+) 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: