Bluetooth: btmtksdio: Fix hdev->stat.byte_rx accumulation
authorSean Wang <sean.wang@mediatek.com>
Thu, 18 Apr 2019 09:08:01 +0000 (17:08 +0800)
committerMarcel Holtmann <marcel@holtmann.org>
Tue, 23 Apr 2019 16:36:20 +0000 (18:36 +0200)
Accumulate hdev->stat.byte_rx only for valid packets as btmtkuart doing.

Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
drivers/bluetooth/btmtksdio.c

index 9c123a9de673ad10a1e07d3af4797d1a7b36c2c6..877c0a8317755633d820049a1cc671254c3cf627 100644 (file)
@@ -391,8 +391,6 @@ static int btmtksdio_rx_packet(struct btmtksdio_dev *bdev, u16 rx_size)
        if (err < 0)
                goto err_kfree_skb;
 
-       bdev->hdev->stat.byte_rx += rx_size;
-
        sdio_hdr = (void *)skb->data;
 
        /* We assume the default error as -EILSEQ simply to make the error path
@@ -457,6 +455,8 @@ static int btmtksdio_rx_packet(struct btmtksdio_dev *bdev, u16 rx_size)
        /* Complete frame */
        (&pkts[i])->recv(bdev->hdev, skb);
 
+       bdev->hdev->stat.byte_rx += rx_size;
+
        return 0;
 
 err_kfree_skb: