diff options
author | Ivo van Doorn <ivdoorn@gmail.com> | 2008-12-20 11:00:23 +0100 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-01-12 20:24:53 +0100 |
commit | d15cfc3ac77388f1d588c57743d5f26b15eba9a8 (patch) | |
tree | 7e664f2ea89585ff090edb9f265d573db512d874 /drivers/net/wireless/rt2x00 | |
parent | p54usb: fix random traffic stalls (LM87) (diff) | |
download | linux-d15cfc3ac77388f1d588c57743d5f26b15eba9a8.tar.xz linux-d15cfc3ac77388f1d588c57743d5f26b15eba9a8.zip |
rt2x00: Fix segementation fault
The queue_end() macro points to 1 position after the
queue, which means that if we want to know if queue
is at the end of the queue we should first increment
the position and then check if it is a valid entry.
This fixes a segmentation fault which only occurs when
the device has enough endpoints to provide a dedicated
endpoint for all TX queues (which likely won't happen
for rt2500usb and rt73usb, but will happen for rt2800usb).
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rt2x00')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00usb.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00usb.c b/drivers/net/wireless/rt2x00/rt2x00usb.c index 83df312ac56f..0b29d767a258 100644 --- a/drivers/net/wireless/rt2x00/rt2x00usb.c +++ b/drivers/net/wireless/rt2x00/rt2x00usb.c @@ -434,11 +434,11 @@ static int rt2x00usb_find_endpoints(struct rt2x00_dev *rt2x00dev) if (usb_endpoint_is_bulk_in(ep_desc)) { rt2x00usb_assign_endpoint(rt2x00dev->rx, ep_desc); - } else if (usb_endpoint_is_bulk_out(ep_desc)) { + } else if (usb_endpoint_is_bulk_out(ep_desc) && + (queue != queue_end(rt2x00dev))) { rt2x00usb_assign_endpoint(queue, ep_desc); + queue = queue_next(queue); - if (queue != queue_end(rt2x00dev)) - queue = queue_next(queue); tx_ep_desc = ep_desc; } } |