staging: wfx: fix counter overflow
authorJérôme Pouiller <jerome.pouiller@silabs.com>
Tue, 17 Dec 2019 16:14:30 +0000 (16:14 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Dec 2019 14:51:03 +0000 (15:51 +0100)
Some weird behaviors were observed when connection is really good and
packets are small. It appears that sometime, number of packets in queues
can exceed 255 and generate an overflow in field usage_count.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20191217161318.31402-4-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/wfx/data_tx.h

index a0f9ae6..f63e5d8 100644 (file)
@@ -39,8 +39,8 @@ struct wfx_link_entry {
 
 struct tx_policy {
        struct list_head link;
+       int usage_count;
        u8 rates[12];
-       u8 usage_count;
        u8 uploaded;
 };