Re: [PATCH] usb: gadget: f_hid: fix: Move IN request allocation to set_alt()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Mar 22, 2018 at 02:53:11PM -0500, Bin Liu wrote:
> From: Krzysztof Opasiak <kopasiak90@xxxxxxxxx>
> 
> commit 749494b6bdbbaf0899aa1c62a1ad74cd747bce47 upstream.
> 
> Since commit: ba1582f22231 ("usb: gadget: f_hid: use alloc_ep_req()")
> we cannot allocate any requests in bind() as we check if we should
> align request buffer based on endpoint descriptor which is assigned
> in set_alt().
> 
> Allocating request in bind() function causes a NULL pointer
> dereference.
> 
> This commit moves allocation of IN request from bind() to set_alt()
> to prevent this issue.
> 
> Fixes: ba1582f22231 ("usb: gadget: f_hid: use alloc_ep_req()")
> Tested-by: David Lechner <david@xxxxxxxxxxxxxx>
> Signed-off-by: Krzysztof Opasiak <k.opasiak@xxxxxxxxxxx>
> Signed-off-by: Felipe Balbi <felipe.balbi@xxxxxxxxxxxxxxx>
> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
> ---
> 
> This backport is for v4.9 only.

Thanks, now queued up.

greg k-h



[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]