usb: gadget: f_hid: fix: Move IN request allocation to set_alt()
Subsystems (2)
Quoted 15 lines · Bin Liu
From: Krzysztof Opasiak <[email protected]>
commit
749494b6bdbbaf0899aa1c62a1ad74cd747bce47upstream.Since commit:
ba1582f22231("usb: gadget:f_hid: usealloc_ep_req()") we cannot allocate any requests inbind()as we check if we should align request buffer based on endpoint descriptor which is assigned inset_alt().Allocating request in
bind()function causes a NULL pointer dereference.This commit moves allocation of IN request from
bind()toset_alt()to prevent this issue.
Quoted 8 lines
Fixes ba1582f22231 ("usb: gadget: f_hid: use alloc_ep_req()")Tested-by David Lechner <[email protected]>Signed-off-by Krzysztof Opasiak <[email protected]>Signed-off-by Felipe Balbi <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>---
This backport is for v4.9 only.
Thanks, now queued up.
greg k-h
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html