39 lines
1.2 KiB
Diff
39 lines
1.2 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Dongwon Kim <dongwon.kim@intel.com>
|
|
Date: Mon, 17 Jun 2019 23:07:03 -0700
|
|
Subject: [PATCH] dma-buf/hyper_dmabuf: mutex protection on processing of
|
|
UNEXPORT_NOTIFY
|
|
|
|
To prevent synchronization issue on "imported", mutex protection has
|
|
been added to "UNEXPORT_NOTIFY" msg handling.
|
|
|
|
Signed-off-by: Dongwon Kim <dongwon.kim@intel.com>
|
|
---
|
|
drivers/dma-buf/hyper_dmabuf/hyper_dmabuf_msg.c | 3 +++
|
|
1 file changed, 3 insertions(+)
|
|
|
|
diff --git a/drivers/dma-buf/hyper_dmabuf/hyper_dmabuf_msg.c b/drivers/dma-buf/hyper_dmabuf/hyper_dmabuf_msg.c
|
|
index d5a0afdcaa7f..03efbcf6fd6a 100644
|
|
--- a/drivers/dma-buf/hyper_dmabuf/hyper_dmabuf_msg.c
|
|
+++ b/drivers/dma-buf/hyper_dmabuf/hyper_dmabuf_msg.c
|
|
@@ -314,6 +314,7 @@ int hyper_dmabuf_msg_parse(int domid, struct hyper_dmabuf_req *req)
|
|
dev_dbg(hy_drv_priv->dev,
|
|
"processing HYPER_DMABUF_NOTIFY_UNEXPORT\n");
|
|
|
|
+ mutex_lock(&hy_drv_priv->lock);
|
|
imported = hyper_dmabuf_find_imported(hid);
|
|
|
|
if (imported) {
|
|
@@ -336,6 +337,8 @@ int hyper_dmabuf_msg_parse(int domid, struct hyper_dmabuf_req *req)
|
|
req->stat = HYPER_DMABUF_REQ_ERROR;
|
|
}
|
|
|
|
+ mutex_unlock(&hy_drv_priv->lock);
|
|
+
|
|
return req->cmd;
|
|
}
|
|
|
|
--
|
|
https://clearlinux.org
|
|
|