diff options
author | David S. Miller <davem@davemloft.net> | 2020-03-12 21:29:30 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-03-12 22:34:48 -0700 |
commit | 1d343579312311aa9875b34d5a921f5e2ec69f0a (patch) | |
tree | 64b636b5557d92f5266187f035dac34862db86d5 /drivers/net/wireless/mediatek/mt76/dma.c | |
parent | a8eceea84a3a3504e42f6495cf462027c5d19cb0 (diff) | |
parent | 0d81a3f29c0afb18ba2b1275dcccf21e0dd4da38 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Minor overlapping changes, nothing serious.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/wireless/mediatek/mt76/dma.c')
-rw-r--r-- | drivers/net/wireless/mediatek/mt76/dma.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/dma.c b/drivers/net/wireless/mediatek/mt76/dma.c index e5dd7080e88e..75e659774e07 100644 --- a/drivers/net/wireless/mediatek/mt76/dma.c +++ b/drivers/net/wireless/mediatek/mt76/dma.c @@ -467,10 +467,13 @@ mt76_add_fragment(struct mt76_dev *dev, struct mt76_queue *q, void *data, struct page *page = virt_to_head_page(data); int offset = data - page_address(page); struct sk_buff *skb = q->rx_head; + struct skb_shared_info *shinfo = skb_shinfo(skb); - offset += q->buf_offset; - skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags, page, offset, len, - q->buf_size); + if (shinfo->nr_frags < ARRAY_SIZE(shinfo->frags)) { + offset += q->buf_offset; + skb_add_rx_frag(skb, shinfo->nr_frags, page, offset, len, + q->buf_size); + } if (more) return; |