OSDN Git Service

ionic: update eid test for overflow
authorShannon Nelson <snelson@pensando.io>
Tue, 21 Jul 2020 20:34:07 +0000 (13:34 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 22 Jul 2020 01:36:34 +0000 (18:36 -0700)
Fix up our comparison to better handle a potential (but largely
unlikely) wrap around.

Signed-off-by: Shannon Nelson <snelson@pensando.io>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/pensando/ionic/ionic_lif.c

index bbfa25c..db60c54 100644 (file)
@@ -719,7 +719,7 @@ static bool ionic_notifyq_service(struct ionic_cq *cq,
        eid = le64_to_cpu(comp->event.eid);
 
        /* Have we run out of new completions to process? */
-       if (eid <= lif->last_eid)
+       if ((s64)(eid - lif->last_eid) <= 0)
                return false;
 
        lif->last_eid = eid;