From: Sean Wang Date: Thu, 18 Apr 2019 09:08:01 +0000 (+0800) Subject: Bluetooth: btmtksdio: Fix hdev->stat.byte_rx accumulation X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=bcaa7d72dffddfa4196a37108d67fc12fb4edfca;p=linux.git Bluetooth: btmtksdio: Fix hdev->stat.byte_rx accumulation Accumulate hdev->stat.byte_rx only for valid packets as btmtkuart doing. Signed-off-by: Sean Wang Signed-off-by: Marcel Holtmann --- diff --git a/drivers/bluetooth/btmtksdio.c b/drivers/bluetooth/btmtksdio.c index 9c123a9de673a..877c0a8317755 100644 --- a/drivers/bluetooth/btmtksdio.c +++ b/drivers/bluetooth/btmtksdio.c @@ -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: