diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2018-07-04 12:48:53 +0300 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2018-11-20 21:05:37 +0300 |
commit | 31330d438db7c3fa5be06d9585583997c32f04ed (patch) | |
tree | 3eb4e202ffb3e0a2b3f92e06374c98f4e840ed42 /drivers/usb/host/xhci-mem.c | |
parent | f5d54bc7627a76c136056cb1463ae8ff1609beb0 (diff) | |
download | linux-31330d438db7c3fa5be06d9585583997c32f04ed.tar.xz |
xhci: xhci-mem: off by one in xhci_stream_id_to_ring()
commit 313db3d6488bb03b61b99de9dbca061f1fd838e1 upstream.
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'drivers/usb/host/xhci-mem.c')
-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 1ee27ce9395b..792d69fbf356 100644 --- a/drivers/usb/host/xhci-mem.c +++ b/drivers/usb/host/xhci-mem.c @@ -638,7 +638,7 @@ struct xhci_ring *xhci_stream_id_to_ring( if (!ep->stream_info) return NULL; - if (stream_id > ep->stream_info->num_streams) + if (stream_id >= ep->stream_info->num_streams) return NULL; return ep->stream_info->stream_rings[stream_id]; } |