infiniband: nes: Fix more direct skb list accesses.
authorDavid S. Miller <davem@davemloft.net>
Sat, 10 Nov 2018 05:18:48 +0000 (21:18 -0800)
committerDavid S. Miller <davem@davemloft.net>
Sat, 10 Nov 2018 05:19:44 +0000 (21:19 -0800)
The following:

skb = skb->next;
...
if (skb == (struct sk_buff *)queue)

is transformed into:

skb = skb_peek_next(skb, queue);
...
if (!skb)

Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/infiniband/hw/nes/nes_mgt.c

index e96ffff61c3a631179baad3afaa710fcd5c6d6de..fc0c191014e908eea32d752f3499295ef143aa0a 100644 (file)
@@ -223,11 +223,11 @@ static struct sk_buff *nes_get_next_skb(struct nes_device *nesdev, struct nes_qp
                }
 
                old_skb = skb;
-               skb = skb->next;
+               skb = skb_peek_next(skb, &nesqp->pau_list);
                skb_unlink(old_skb, &nesqp->pau_list);
                nes_mgt_free_skb(nesdev, old_skb, PCI_DMA_TODEVICE);
                nes_rem_ref_cm_node(nesqp->cm_node);
-               if (skb == (struct sk_buff *)&nesqp->pau_list)
+               if (!skb)
                        goto out;
        }
        return skb;