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

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

Merge "msm: mink: Accept zero args for invoke command"

parents a7d7221f 9f18e779
Loading
Loading
Loading
Loading
+14 −10
Original line number Diff line number Diff line
@@ -375,24 +375,28 @@ long smcinvoke_ioctl(struct file *filp, unsigned cmd, unsigned long arg)
		nr_args = object_counts_num_buffers(req.counts) +
				object_counts_num_objects(req.counts);

		if (!nr_args || req.argsize != sizeof(union smcinvoke_arg)) {
		if (req.argsize != sizeof(union smcinvoke_arg)) {
			ret = -EINVAL;
			goto out;
		}

		if (nr_args) {

			args_buf = kzalloc(nr_args * req.argsize, GFP_KERNEL);
			if (!args_buf) {
				ret = -ENOMEM;
				goto out;
			}

		ret = copy_from_user(args_buf, (void __user *)(req.args),
			ret = copy_from_user(args_buf,
						(void __user *)(req.args),
						nr_args * req.argsize);

			if (ret) {
				ret = -EFAULT;
				goto out;
			}
		}

		inmsg_size = compute_in_msg_size(&req, args_buf);
		in_msg = (void *)__get_free_pages(GFP_KERNEL,