Commit d5a047fd authored by Linus Torvalds's avatar Linus Torvalds

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
parents 9e8f8f1e 443064cb
...@@ -765,10 +765,12 @@ static long ashmem_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -765,10 +765,12 @@ static long ashmem_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
break; break;
case ASHMEM_SET_SIZE: case ASHMEM_SET_SIZE:
ret = -EINVAL; ret = -EINVAL;
mutex_lock(&ashmem_mutex);
if (!asma->file) { if (!asma->file) {
ret = 0; ret = 0;
asma->size = (size_t)arg; asma->size = (size_t)arg;
} }
mutex_unlock(&ashmem_mutex);
break; break;
case ASHMEM_GET_SIZE: case ASHMEM_GET_SIZE:
ret = asma->size; ret = asma->size;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment