diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2018-07-04 12:48:53 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-07-17 12:39:26 +0300 |
commit | 7499390b8ba5e4c9d378d301f7fd7db9be28f922 (patch) | |
tree | 5b200dc6d7c79eff2688398e57c73ac9b012bb1b /drivers/usb | |
parent | 55f51e5b4cffc6d98b945868281c67dbf0368c25 (diff) | |
download | linux-7499390b8ba5e4c9d378d301f7fd7db9be28f922.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>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb')
-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 00b710016d21..b7b55eb82714 100644 --- a/drivers/usb/host/xhci-mem.c +++ b/drivers/usb/host/xhci-mem.c @@ -604,7 +604,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]; } |