Commit a0ee619f authored by Hans de Goede's avatar Hans de Goede Committed by Greg Kroah-Hartman

xhci: Add missing checks for xhci_alloc_command failure

Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 170625e9
...@@ -1118,6 +1118,10 @@ static void xhci_handle_cmd_reset_ep(struct xhci_hcd *xhci, int slot_id, ...@@ -1118,6 +1118,10 @@ static void xhci_handle_cmd_reset_ep(struct xhci_hcd *xhci, int slot_id,
if (xhci->quirks & XHCI_RESET_EP_QUIRK) { if (xhci->quirks & XHCI_RESET_EP_QUIRK) {
struct xhci_command *command; struct xhci_command *command;
command = xhci_alloc_command(xhci, false, false, GFP_ATOMIC); command = xhci_alloc_command(xhci, false, false, GFP_ATOMIC);
if (!command) {
xhci_warn(xhci, "WARN Cannot submit cfg ep: ENOMEM\n");
return;
}
xhci_dbg_trace(xhci, trace_xhci_dbg_quirks, xhci_dbg_trace(xhci, trace_xhci_dbg_quirks,
"Queueing configure endpoint command"); "Queueing configure endpoint command");
xhci_queue_configure_endpoint(xhci, command, xhci_queue_configure_endpoint(xhci, command,
......
...@@ -1553,6 +1553,10 @@ int xhci_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status) ...@@ -1553,6 +1553,10 @@ int xhci_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status)
*/ */
if (!(ep->ep_state & EP_HALT_PENDING)) { if (!(ep->ep_state & EP_HALT_PENDING)) {
command = xhci_alloc_command(xhci, false, false, GFP_ATOMIC); command = xhci_alloc_command(xhci, false, false, GFP_ATOMIC);
if (!command) {
ret = -ENOMEM;
goto done;
}
ep->ep_state |= EP_HALT_PENDING; ep->ep_state |= EP_HALT_PENDING;
ep->stop_cmds_pending++; ep->stop_cmds_pending++;
ep->stop_cmd_timer.expires = jiffies + ep->stop_cmd_timer.expires = jiffies +
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment