Skip to content

Commit

Permalink
[PATCH] zd1211rw: Optimized handling of zero length entries in length…
Browse files Browse the repository at this point in the history
… 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>
  • Loading branch information
Ulrich Kunitz authored and Jeff Garzik committed Dec 2, 2006
1 parent 741fec5 commit 850c211
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/net/wireless/zd1211rw/zd_usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,8 @@ static void handle_rx_packet(struct zd_usb *usb, const u8 *buffer,
unsigned int l, k, n;
for (i = 0, l = 0;; i++) {
k = le16_to_cpu(get_unaligned(&length_info->length[i]));
if (k == 0)
return;
n = l+k;
if (n > length)
return;
Expand Down

0 comments on commit 850c211

Please sign in to comment.