Skip to content
Snippets Groups Projects
Commit e9203175 authored by Ariel Yin's avatar Ariel Yin Committed by Android Partner Code Review
Browse files

Merge "staging: android: ashmem: fix a race condition in ASHMEM_SET_SIZE...

Merge "staging: android: ashmem: fix a race condition in ASHMEM_SET_SIZE ioctl" into mnc-dr-dev-qcom-lego
parents d37402aa d657d8e2
No related branches found
No related tags found
No related merge requests found
......@@ -672,10 +672,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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment