Skip to content

Commit

Permalink
Bluetooth: btmtksdio: Fix hdev->stat.byte_rx accumulation
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Sean Wang authored and Marcel Holtmann committed Apr 23, 2019
1 parent 2e47cc2 commit bcaa7d7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/bluetooth/btmtksdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit bcaa7d7

Please sign in to comment.