aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorTatyana Nikolova <Tatyana.E.Nikolova@intel.com>2012-11-02 19:17:45 -0400
committerRoland Dreier <roland@purestorage.com>2012-11-22 03:49:13 -0500
commitbff3976bef4f917554292d48ce43636f3d040182 (patch)
treeaf139ccfac997af413ef473ad273f590244b4788 /drivers/infiniband
parent3127e4ea54fc023e35adb1d9af29d49c6d582d12 (diff)
RDMA/nes: Fix for unlinking skbs from empty list
Signed-off-by: Tatyana Nikolova <Tatyana.E.Nikolova@intel.com> Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/hw/nes/nes_mgt.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/infiniband/hw/nes/nes_mgt.c b/drivers/infiniband/hw/nes/nes_mgt.c
index 8cf74fd0c44f..1f5d69e7793a 100644
--- a/drivers/infiniband/hw/nes/nes_mgt.c
+++ b/drivers/infiniband/hw/nes/nes_mgt.c
@@ -210,6 +210,9 @@ static struct sk_buff *nes_get_next_skb(struct nes_device *nesdev, struct nes_qp
210 } 210 }
211 211
212 while (1) { 212 while (1) {
213 if (skb_queue_empty(&nesqp->pau_list))
214 goto out;
215
213 seq = nes_get_seq(skb, ack, wnd, fin_rcvd, rst_rcvd); 216 seq = nes_get_seq(skb, ack, wnd, fin_rcvd, rst_rcvd);
214 if (seq == nextseq) { 217 if (seq == nextseq) {
215 if (skb->len || processacks) 218 if (skb->len || processacks)
@@ -218,14 +221,13 @@ static struct sk_buff *nes_get_next_skb(struct nes_device *nesdev, struct nes_qp
218 goto out; 221 goto out;
219 } 222 }
220 223
221 if (skb->next == (struct sk_buff *)&nesqp->pau_list)
222 goto out;
223
224 old_skb = skb; 224 old_skb = skb;
225 skb = skb->next; 225 skb = skb->next;
226 skb_unlink(old_skb, &nesqp->pau_list); 226 skb_unlink(old_skb, &nesqp->pau_list);
227 nes_mgt_free_skb(nesdev, old_skb, PCI_DMA_TODEVICE); 227 nes_mgt_free_skb(nesdev, old_skb, PCI_DMA_TODEVICE);
228 nes_rem_ref_cm_node(nesqp->cm_node); 228 nes_rem_ref_cm_node(nesqp->cm_node);
229 if (skb == (struct sk_buff *)&nesqp->pau_list)
230 goto out;
229 } 231 }
230 return skb; 232 return skb;
231 233
@@ -384,7 +386,8 @@ static int get_fpdu_info(struct nes_device *nesdev, struct nes_qp *nesqp,
384 if (frags[i].skb->len == 0) { 386 if (frags[i].skb->len == 0) {
385 /* Pull skb off the list - it will be freed in the callback */ 387 /* Pull skb off the list - it will be freed in the callback */
386 spin_lock_irqsave(&nesqp->pau_lock, flags); 388 spin_lock_irqsave(&nesqp->pau_lock, flags);
387 skb_unlink(frags[i].skb, &nesqp->pau_list); 389 if (!skb_queue_empty(&nesqp->pau_list))
390 skb_unlink(frags[i].skb, &nesqp->pau_list);
388 spin_unlock_irqrestore(&nesqp->pau_lock, flags); 391 spin_unlock_irqrestore(&nesqp->pau_lock, flags);
389 } else { 392 } else {
390 /* Last skb still has data so update the seq */ 393 /* Last skb still has data so update the seq */