diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2018-07-04 05:48:53 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-07-06 10:28:31 -0400 |
commit | 313db3d6488bb03b61b99de9dbca061f1fd838e1 (patch) | |
tree | 6e6d580c3380d76798b1280a30c3fcc02eaafc38 | |
parent | aaa8fee7dfc974d7f057bc9f1d8e305a114469ad (diff) |
xhci: xhci-mem: off by one in xhci_stream_id_to_ring()
The > should be >= here so that we don't read one element beyond the end
of the ep->stream_info->stream_rings[] array.
Fixes: e9df17eb1408 ("USB: xhci: Correct assumptions about number of rings per endpoint.")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/usb/host/xhci-mem.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c index 8a62eee9eee1..ef350c33dc4a 100644 --- a/drivers/usb/host/xhci-mem.c +++ b/drivers/usb/host/xhci-mem.c | |||
@@ -595,7 +595,7 @@ struct xhci_ring *xhci_stream_id_to_ring( | |||
595 | if (!ep->stream_info) | 595 | if (!ep->stream_info) |
596 | return NULL; | 596 | return NULL; |
597 | 597 | ||
598 | if (stream_id > ep->stream_info->num_streams) | 598 | if (stream_id >= ep->stream_info->num_streams) |
599 | return NULL; | 599 | return NULL; |
600 | return ep->stream_info->stream_rings[stream_id]; | 600 | return ep->stream_info->stream_rings[stream_id]; |
601 | } | 601 | } |