2017-11-07 17:32:46 -05:00
|
|
|
From 1c4ddc4c7a4fcdf9371048ce01a6b0e5d2a2bae9 Mon Sep 17 00:00:00 2001
|
2017-10-29 01:48:53 -04:00
|
|
|
From: Sunil Khatri <sunilkh@codeaurora.org>
|
2017-11-07 17:32:46 -05:00
|
|
|
Date: Thu, 6 Apr 2017 18:28:31 +0530
|
|
|
|
Subject: msm: kgsl: Fix the race between context create and destroy
|
2017-10-29 01:48:53 -04:00
|
|
|
|
|
|
|
Hold the context lock before updating the context id in
|
|
|
|
param->drawctxt_id to avoid race condition between context
|
|
|
|
creation and context destroy.
|
|
|
|
|
|
|
|
Change-Id: Ic26d3e5b68078c02d15c38080b1a262ea4b1f7fe
|
|
|
|
Signed-off-by: Sunil Khatri <sunilkh@codeaurora.org>
|
|
|
|
---
|
|
|
|
drivers/gpu/msm/kgsl.c | 2 +-
|
|
|
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
|
|
|
|
|
diff --git a/drivers/gpu/msm/kgsl.c b/drivers/gpu/msm/kgsl.c
|
2017-11-07 17:32:46 -05:00
|
|
|
index 1de8e21..54f591e4 100644
|
2017-10-29 01:48:53 -04:00
|
|
|
--- a/drivers/gpu/msm/kgsl.c
|
|
|
|
+++ b/drivers/gpu/msm/kgsl.c
|
2017-11-07 17:32:46 -05:00
|
|
|
@@ -1764,9 +1764,9 @@ long kgsl_ioctl_drawctxt_create(struct kgsl_device_private *dev_priv,
|
2017-10-29 01:48:53 -04:00
|
|
|
/* Commit the pointer to the context in context_idr */
|
|
|
|
write_lock(&device->context_lock);
|
|
|
|
idr_replace(&device->context_idr, context, context->id);
|
|
|
|
+ param->drawctxt_id = context->id;
|
|
|
|
write_unlock(&device->context_lock);
|
|
|
|
|
|
|
|
- param->drawctxt_id = context->id;
|
|
|
|
done:
|
|
|
|
return result;
|
|
|
|
}
|
2017-11-07 17:32:46 -05:00
|
|
|
--
|
|
|
|
cgit v1.1
|
|
|
|
|