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]
Date:	Wed, 27 Jul 2016 22:03:38 +0200
From:	Michal Nazarewicz <mina86@...a86.com>
To:	"Felipe F. Tonello" <eu@...ipetonello.com>,
	linux-usb@...r.kernel.org
Cc:	linux-kernel@...r.kernel.org, Felipe Balbi <balbi@...nel.org>,
	Baolin Wang <baolin.wang@...aro.org>,
	Andrzej Pietrasiewicz <andrzej.p@...sung.com>
Subject: Re: [PATCH 8/9] usb: gadget: f_hid: use free_ep_req()

On Tue, Jul 26 2016, Felipe F. Tonello wrote:
> We should always use free_ep_req() when allocating requests with
> alloc_ep_req().
>
> Signed-off-by: Felipe F. Tonello <eu@...ipetonello.com>

Acked-by: Michal Nazarewicz <mina86@...a86.com>

> ---
>  drivers/usb/gadget/function/f_hid.c | 10 +++-------
>  1 file changed, 3 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/usb/gadget/function/f_hid.c b/drivers/usb/gadget/function/f_hid.c
> index e82a7468252e..a010496e4e05 100644
> --- a/drivers/usb/gadget/function/f_hid.c
> +++ b/drivers/usb/gadget/function/f_hid.c
> @@ -671,11 +671,8 @@ fail_free_descs:
>  	usb_free_all_descriptors(f);
>  fail:
>  	ERROR(f->config->cdev, "hidg_bind FAILED\n");
> -	if (hidg->req != NULL) {
> -		kfree(hidg->req->buf);
> -		if (hidg->in_ep != NULL)
> -			usb_ep_free_request(hidg->in_ep, hidg->req);
> -	}
> +	if (hidg->req != NULL)
> +		free_ep_req(hidg->in_ep, hidg->req);
>  
>  	return status;
>  }
> @@ -904,8 +901,7 @@ static void hidg_unbind(struct usb_configuration *c, struct usb_function *f)
>  
>  	/* disable/free request and end point */
>  	usb_ep_disable(hidg->in_ep);
> -	kfree(hidg->req->buf);
> -	usb_ep_free_request(hidg->in_ep, hidg->req);
> +	free_ep_req(hidg->in_ep, hidg->req);
>  
>  	usb_free_all_descriptors(f);
>  }
> -- 
> 2.9.0
>

-- 
Best regards
ミハウ “𝓶𝓲𝓷𝓪86” ナザレヴイツ
«If at first you don’t succeed, give up skydiving»

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ