brcmfmac: Use __skb_peek().
authorDavid S. Miller <davem@davemloft.net>
Sun, 12 Aug 2018 04:19:19 +0000 (21:19 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 10 Sep 2018 17:06:54 +0000 (10:06 -0700)
Instead of direct SKB list pointer accesses.

In these situations, we absolutely know that the SKB queue in question
is non-empty.

Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c

index d2f788d8866814ec1e8e02444c9ca1de26615a87..3e37c8cf82c6141f508213fc129014c32fc45651 100644 (file)
@@ -576,7 +576,7 @@ int brcmf_sdiod_recv_chain(struct brcmf_sdio_dev *sdiodev,
 
        if (pktq->qlen == 1)
                err = brcmf_sdiod_skbuff_read(sdiodev, sdiodev->func2, addr,
-                                             pktq->next);
+                                             __skb_peek(pktq));
        else if (!sdiodev->sg_support) {
                glom_skb = brcmu_pkt_buf_get_skb(totlen);
                if (!glom_skb)
index a907d7b065fa8e0b7ab6a35dc2c265a6385d9c75..1e2fd289323aa210be3c2d1af6cb065ff199d5a4 100644 (file)
@@ -2189,7 +2189,7 @@ brcmf_sdio_txpkt_prep(struct brcmf_sdio *bus, struct sk_buff_head *pktq,
         * length of the chain (including padding)
         */
        if (bus->txglom)
-               brcmf_sdio_update_hwhdr(pktq->next->data, total_len);
+               brcmf_sdio_update_hwhdr(__skb_peek(pktq)->data, total_len);
        return 0;
 }