summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-01-13 14:04:06 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2018-01-13 14:04:06 -0800
commitd5a047fd92c6e0db7d56b9e20200cc30f6c7c8e2 (patch)
tree229f38b29f90efa6a300aadbd25ee3d27ba131ec
parent9e8f8f1ef4f804b8fd81beaa8afa9cbe0f175935 (diff)
parent443064cb0b1fb4569fe0a71209da7625129fb760 (diff)
downloadlinux-d5a047fd92c6e0db7d56b9e20200cc30f6c7c8e2.tar.bz2
Merge tag 'staging-4.15-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging
Pull staging driver fix from Greg KH: "Here is a single android ashmem bugfix that resolves a reported issue in that interface. It's been in linux-next this week with no reported issues" * tag 'staging-4.15-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: staging: android: ashmem: fix a race condition in ASHMEM_SET_SIZE ioctl
-rw-r--r--drivers/staging/android/ashmem.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/staging/android/ashmem.c b/drivers/staging/android/ashmem.c
index 0f695df14c9d..372ce9913e6d 100644
--- a/drivers/staging/android/ashmem.c
+++ b/drivers/staging/android/ashmem.c
@@ -765,10 +765,12 @@ static long ashmem_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
break;
case ASHMEM_SET_SIZE:
ret = -EINVAL;
+ mutex_lock(&ashmem_mutex);
if (!asma->file) {
ret = 0;
asma->size = (size_t)arg;
}
+ mutex_unlock(&ashmem_mutex);
break;
case ASHMEM_GET_SIZE:
ret = asma->size;