mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-05 16:37:50 +00:00
xhci: Do not use GFP_KERNEL in (potentially) atomic context
commitdda32c00c9
upstream. 'xhci_urb_enqueue()' is passed a 'mem_flags' argument, because "URBs may be submitted in interrupt context" (see comment related to 'usb_submit_urb()' in 'drivers/usb/core/urb.c') So this flag should be used in all the calling chain. Up to now, 'xhci_check_maxpacket()' which is only called from 'xhci_urb_enqueue()', uses GFP_KERNEL. Be safe and pass the mem_flags to this function as well. Fixes:ddba5cd0ae
("xhci: Use command structures when queuing commands on the command ring") Cc: <stable@vger.kernel.org> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Link: https://lore.kernel.org/r/20210512080816.866037-4-mathias.nyman@linux.intel.com [iwamatsu: Adjust context] Signed-off-by: Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
13908efd42
commit
7d46f70b3f
1 changed files with 3 additions and 3 deletions
|
@ -1308,7 +1308,7 @@ static int xhci_configure_endpoint(struct xhci_hcd *xhci,
|
|||
* we need to issue an evaluate context command and wait on it.
|
||||
*/
|
||||
static int xhci_check_maxpacket(struct xhci_hcd *xhci, unsigned int slot_id,
|
||||
unsigned int ep_index, struct urb *urb)
|
||||
unsigned int ep_index, struct urb *urb, gfp_t mem_flags)
|
||||
{
|
||||
struct xhci_container_ctx *out_ctx;
|
||||
struct xhci_input_control_ctx *ctrl_ctx;
|
||||
|
@ -1339,7 +1339,7 @@ static int xhci_check_maxpacket(struct xhci_hcd *xhci, unsigned int slot_id,
|
|||
* changes max packet sizes.
|
||||
*/
|
||||
|
||||
command = xhci_alloc_command(xhci, false, true, GFP_KERNEL);
|
||||
command = xhci_alloc_command(xhci, false, true, mem_flags);
|
||||
if (!command)
|
||||
return -ENOMEM;
|
||||
|
||||
|
@ -1430,7 +1430,7 @@ static int xhci_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, gfp_t mem_flag
|
|||
*/
|
||||
if (urb->dev->speed == USB_SPEED_FULL) {
|
||||
ret = xhci_check_maxpacket(xhci, slot_id,
|
||||
ep_index, urb);
|
||||
ep_index, urb, mem_flags);
|
||||
if (ret < 0) {
|
||||
xhci_urb_free_priv(urb_priv);
|
||||
urb->hcpriv = NULL;
|
||||
|
|
Loading…
Reference in a new issue