i40iw: Update list correctly
authorHenry Orosco <henry.orosco@intel.com>
Fri, 23 Jun 2017 21:04:01 +0000 (16:04 -0500)
committerDoug Ledford <dledford@redhat.com>
Thu, 20 Jul 2017 15:20:49 +0000 (11:20 -0400)
To avoid infinite loop, in i40iw_ieq_handle_exception, update
plist inside while loop.

Signed-off-by: Henry Orosco <henry.orosco@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/hw/i40iw/i40iw_puda.c

index 1bb1681..71050c5 100644 (file)
@@ -1414,10 +1414,10 @@ static void i40iw_ieq_handle_exception(struct i40iw_puda_rsrc *ieq,
 
        if (!list_empty(rxlist)) {
                tmpbuf = (struct i40iw_puda_buf *)rxlist->next;
-               plist = &tmpbuf->list;
                while ((struct list_head *)tmpbuf != rxlist) {
                        if ((int)(buf->seqnum - tmpbuf->seqnum) < 0)
                                break;
+                       plist = &tmpbuf->list;
                        tmpbuf = (struct i40iw_puda_buf *)plist->next;
                }
                /* Insert buf before tmpbuf */