Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1346407

Re: [PATCH v4 4/5] staging/android: refactor SYNC_IOC_FILE_INFO

From Dan Carpenter <dan.carpenter@oracle.com>
Newsgroups linux.kernel
Subject Re: [PATCH v4 4/5] staging/android: refactor SYNC_IOC_FILE_INFO
Date 2016-03-01 08:00 +0100
Message-ID <r7MrM-5z7-5@gated-at.bofh.it> (permalink)
References <r6vsZ-7nJ-3@gated-at.bofh.it> <r6vt0-7nJ-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri, Feb 26, 2016 at 03:31:46PM -0300, Gustavo Padovan wrote:
> +no_fences:
> +	info->num_fences = sync_file->num_fences;
>  
> -	if (copy_to_user((void __user *)arg, info, len))
> +	if (copy_to_user((void __user *)arg, info, sizeof(*info)))
>  		ret = -EFAULT;
>  	else
>  		ret = 0;

We need to kfree(fence_info) here.

> diff --git a/drivers/staging/android/uapi/sync.h b/drivers/staging/android/uapi/sync.h
> index f0b41ce..9aad623 100644
> --- a/drivers/staging/android/uapi/sync.h
> +++ b/drivers/staging/android/uapi/sync.h
> @@ -42,21 +42,20 @@ struct sync_fence_info {
>  
>  /**
>   * struct sync_file_info - data returned from fence info ioctl
> - * @len:	ioctl caller writes the size of the buffer its passing in.
> - *		ioctl returns length of sync_file_info returned to
> - *		userspace including pt_info.
>   * @name:	name of fence
>   * @status:	status of fence. 1: signaled 0:active <0:error
>   * @num_fences	number of fences in the sync_file
> + * @len:	ioctl caller writes the size of the buffer its passing in.
> + *		ioctl returns length of all fence_infos summed.
>   * @sync_fence_info: array of sync_fence_info for every fence in the sync_file

The documentation needs updating.

>   */
>  struct sync_file_info {
> -	__u32	len;
>  	char	name[32];
>  	__s32	status;
>  	__u32	num_fences;
> +	__u32	len;
>  
> -	__u8	sync_fence_info[0];
> +	__u64	sync_fence_info;
>  };


regards,
dan carpenter

Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

[PATCH v4 4/5] staging/android: refactor SYNC_IOC_FILE_INFO Gustavo Padovan <gustavo@padovan.org> - 2016-02-26 19:40 +0100
  [PATCH] staging/android: refactor SYNC_IOC_FILE_INFO Gustavo Padovan <gustavo@padovan.org> - 2016-02-26 22:10 +0100
    Re: [PATCH] staging/android: refactor SYNC_IOC_FILE_INFO Emil Velikov <emil.l.velikov@gmail.com> - 2016-02-27 03:20 +0100
      Re: [PATCH] staging/android: refactor SYNC_IOC_FILE_INFO Gustavo Padovan <gustavo.padovan@collabora.co.uk> - 2016-02-27 16:30 +0100
        Re: [PATCH] staging/android: refactor SYNC_IOC_FILE_INFO Emil Velikov <emil.l.velikov@gmail.com> - 2016-02-29 09:40 +0100
    Re: [PATCH] staging/android: refactor SYNC_IOC_FILE_INFO Maarten Lankhorst <maarten.lankhorst@linux.intel.com> - 2016-02-29 09:30 +0100
      Re: [PATCH] staging/android: refactor SYNC_IOC_FILE_INFO Gustavo Padovan <gustavo@padovan.org> - 2016-02-29 23:10 +0100
        Re: [PATCH] staging/android: refactor SYNC_IOC_FILE_INFO Maarten Lankhorst <maarten.lankhorst@linux.intel.com> - 2016-03-01 09:40 +0100
          Re: [PATCH] staging/android: refactor SYNC_IOC_FILE_INFO Gustavo Padovan <gustavo.padovan@collabora.co.uk> - 2016-03-01 13:00 +0100
  Re: [PATCH v4 4/5] staging/android: refactor SYNC_IOC_FILE_INFO Dan Carpenter <dan.carpenter@oracle.com> - 2016-03-01 08:00 +0100

csiph-web