From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752165AbcCAG4N (ORCPT ); Tue, 1 Mar 2016 01:56:13 -0500 Received: from userp1040.oracle.com ([156.151.31.81]:42239 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751259AbcCAG4L (ORCPT ); Tue, 1 Mar 2016 01:56:11 -0500 Date: Tue, 1 Mar 2016 09:55:58 +0300 From: Dan Carpenter To: Gustavo Padovan Cc: Greg Kroah-Hartman , devel@driverdev.osuosl.org, Rob Clark , Daniel Stone , Daniel Vetter , Maarten Lankhorst , Riley Andrews , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Arve =?iso-8859-1?B?SGr4bm5lduVn?= , Greg Hackmann , Gustavo Padovan , John Harrison Subject: Re: [PATCH v4 4/5] staging/android: refactor SYNC_IOC_FILE_INFO Message-ID: <20160301065558.GZ32153@mwanda> References: <1456511507-2534-1-git-send-email-gustavo@padovan.org> <1456511507-2534-4-git-send-email-gustavo@padovan.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1456511507-2534-4-git-send-email-gustavo@padovan.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: userv0022.oracle.com [156.151.31.74] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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