diff options
author | Ulrich Kunitz <kune@deine-taler.de> | 2006-11-21 19:06:19 -0500 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2006-12-02 00:12:05 -0500 |
commit | 850c211ce6948bcd71e505be22b7ead99a425bfa (patch) | |
tree | 6d822061488bbfdf1763f0bb4ce347d083813770 /drivers | |
parent | 741fec53f268b691b869ffc70023319406e0cc97 (diff) |
[PATCH] zd1211rw: Optimized handling of zero length entries in length info
There are a high number of split USB transactions, which contain
only one packet but have a length info field. This patch optimizes
this code by stopping parsing the length info structure if a zero
length field is encountered.
Signed-off-by: Ulrich Kunitz <kune@deine-taler.de>
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/zd1211rw/zd_usb.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/wireless/zd1211rw/zd_usb.c b/drivers/net/wireless/zd1211rw/zd_usb.c index c3449cfae7e8..aa782e88754b 100644 --- a/drivers/net/wireless/zd1211rw/zd_usb.c +++ b/drivers/net/wireless/zd1211rw/zd_usb.c | |||
@@ -593,6 +593,8 @@ static void handle_rx_packet(struct zd_usb *usb, const u8 *buffer, | |||
593 | unsigned int l, k, n; | 593 | unsigned int l, k, n; |
594 | for (i = 0, l = 0;; i++) { | 594 | for (i = 0, l = 0;; i++) { |
595 | k = le16_to_cpu(get_unaligned(&length_info->length[i])); | 595 | k = le16_to_cpu(get_unaligned(&length_info->length[i])); |
596 | if (k == 0) | ||
597 | return; | ||
596 | n = l+k; | 598 | n = l+k; |
597 | if (n > length) | 599 | if (n > length) |
598 | return; | 600 | return; |