diff options
author | Hans de Goede <hdegoede@redhat.com> | 2014-08-20 16:41:52 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-09-23 21:46:10 -0700 |
commit | 1e3452e3f08c5af7fb4b08551aaa96b6627c7416 (patch) | |
tree | 2908d29ee0bae8e47385d5f86a12c42874826b4d /drivers/usb/host/xhci.h | |
parent | fac1f48584c1b6c745412cf8c5dbdc1725aad8f2 (diff) | |
download | talos-op-linux-1e3452e3f08c5af7fb4b08551aaa96b6627c7416.tar.gz talos-op-linux-1e3452e3f08c5af7fb4b08551aaa96b6627c7416.zip |
xhci: Move allocating of command for new_dequeue_state to queue_set_tr_deq()
There are multiple reasons for this:
1) This fixes a missing check for xhci_alloc_command failing in
xhci_handle_cmd_stop_ep()
2) This adds a warning when we cannot set the new dequeue state because of
xhci_alloc_command failing
3) It puts the allocation of the command after the sanity checks in
queue_set_tr_deq(), avoiding leaking the command if those fail
4) Since queue_set_tr_deq now owns the command it can free it if queue_command
fails
5) It reduces code duplication
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/host/xhci.h')
-rw-r--r-- | drivers/usb/host/xhci.h | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h index dace5152e179..f4d12f6fcfe8 100644 --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h @@ -1839,7 +1839,6 @@ void xhci_find_new_dequeue_state(struct xhci_hcd *xhci, unsigned int stream_id, struct xhci_td *cur_td, struct xhci_dequeue_state *state); void xhci_queue_new_dequeue_state(struct xhci_hcd *xhci, - struct xhci_command *cmd, unsigned int slot_id, unsigned int ep_index, unsigned int stream_id, struct xhci_dequeue_state *deq_state); |