Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d1f4cfa6 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "ion: msm: update custom caching ioctls for new handle format"

parents 2204993a bd1829c4
Loading
Loading
Loading
Loading
+13 −14
Original line number Diff line number Diff line
@@ -805,7 +805,14 @@ static long msm_ion_custom_ioctl(struct ion_client *client,
					sizeof(struct ion_flush_data)))
			return -EFAULT;

		if (!data.handle) {
		if (data.handle >= 0) {
			handle = ion_handle_get_by_id(client, (int)data.handle);
			if (IS_ERR(handle)) {
				pr_info("%s: Could not find handle: %d\n",
					__func__, (int)data.handle);
				return PTR_ERR(handle);
			}
		} else {
			handle = ion_import_dma_buf(client, data.fd);
			if (IS_ERR(handle)) {
				pr_info("%s: Could not import handle: %p\n",
@@ -820,28 +827,20 @@ static long msm_ion_custom_ioctl(struct ion_client *client,
		end = (unsigned long) data.vaddr + data.length;

		if (start && check_vaddr_bounds(start, end)) {
			up_read(&mm->mmap_sem);
			pr_err("%s: virtual address %p is out of bounds\n",
				__func__, data.vaddr);
			if (!data.handle)
				ion_free(client, handle);
			return -EINVAL;
			ret = -EINVAL;
		} else {
			ret = ion_do_cache_op(client, handle, data.vaddr,
					data.offset, data.length, cmd);
		}

		ret = ion_do_cache_op(client,
				data.handle ? data.handle : handle,
				data.vaddr, data.offset, data.length,
				cmd);

		up_read(&mm->mmap_sem);

		if (!data.handle)
		ion_free(client, handle);

		if (ret < 0)
			return ret;
		break;

	}
	case ION_IOC_PREFETCH:
	{