]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
ionic: update eid test for overflow
authorShannon Nelson <snelson@pensando.io>
Tue, 21 Jul 2020 20:34:07 +0000 (13:34 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Aug 2020 06:16:04 +0000 (08:16 +0200)
[ Upstream commit 3fbc9bb6ca32d12d4d32a7ae32abef67ac95f889 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/pensando/ionic/ionic_lif.c

index c00ec9a0209735ef6a7033a4671186834440884e..e66002251596bf65e84b062890da5275e49137fe 100644 (file)
@@ -666,7 +666,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;