lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87r39hi6vm.fsf@linux.intel.com>
Date:   Mon, 22 Aug 2016 10:45:49 +0300
From:   Felipe Balbi <balbi@...nel.org>
To:     John Youn <John.Youn@...opsys.com>,
        "Felipe F. Tonello" <eu@...ipetonello.com>,
        "linux-usb\@vger.kernel.org" <linux-usb@...r.kernel.org>
Cc:     "linux-kernel\@vger.kernel.org" <linux-kernel@...r.kernel.org>,
        Michal Nazarewicz <mina86@...a86.com>
Subject: Re: [PATCH v4 10/10] usb: gadget: f_hid: use alloc_ep_req()


Hi,

John Youn <John.Youn@...opsys.com> writes:
> On 8/8/2016 1:30 PM, Felipe F. Tonello wrote:
>> Use gadget's framework allocation function instead of directly calling
>> usb_ep_alloc_request().
>> 
>> Signed-off-by: Felipe F. Tonello <eu@...ipetonello.com>
>> ---
>>  drivers/usb/gadget/function/f_hid.c | 6 +-----
>>  1 file changed, 1 insertion(+), 5 deletions(-)
>> 
>> diff --git a/drivers/usb/gadget/function/f_hid.c b/drivers/usb/gadget/function/f_hid.c
>> index a010496e4e05..89d2e9a5a04f 100644
>> --- a/drivers/usb/gadget/function/f_hid.c
>> +++ b/drivers/usb/gadget/function/f_hid.c
>> @@ -611,14 +611,10 @@ static int hidg_bind(struct usb_configuration *c, struct usb_function *f)
>>  
>>  	/* preallocate request and buffer */
>>  	status = -ENOMEM;
>> -	hidg->req = usb_ep_alloc_request(hidg->in_ep, GFP_KERNEL);
>> +	hidg->req = alloc_ep_req(hidg->in_ep, hidg->report_length);
>>  	if (!hidg->req)
>>  		goto fail;
>>  
>> -	hidg->req->buf = kmalloc(hidg->report_length, GFP_KERNEL);
>> -	if (!hidg->req->buf)
>> -		goto fail;
>> -
>>  	/* set descriptor dynamic values */
>>  	hidg_interface_desc.bInterfaceSubClass = hidg->bInterfaceSubClass;
>>  	hidg_interface_desc.bInterfaceProtocol = hidg->bInterfaceProtocol;
>> 
>
> Hi Felipe,
>
> This commit on your testing/next breaks compilation.
>
> ../drivers/usb/gadget/function/f_hid.c: In function ‘hidg_bind’:
> ../drivers/usb/gadget/function/f_hid.c:620:14: error: too few arguments to function ‘alloc_ep_req’
>   hidg->req = alloc_ep_req(hidg->in_ep, hidg->report_length);
>               ^
> In file included from ../drivers/usb/gadget/function/f_hid.c:24:0:
> ../drivers/usb/gadget/u_f.h:63:21: note: declared here
>  struct usb_request *alloc_ep_req(struct usb_ep *ep, size_t len, int default_len);

true that :-) Dropping from my queue.

-- 
balbi

Download attachment "signature.asc" of type "application/pgp-signature" (801 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ