diff --git a/inventory_provider/snmp.py b/inventory_provider/snmp.py
index 7947cf35382cff01595b33f5d42f5f54b6536e2f..92cc3a835a1c7e00a9abbe9b51ea11cb41e1e1ea 100644
--- a/inventory_provider/snmp.py
+++ b/inventory_provider/snmp.py
@@ -74,7 +74,7 @@ def walk(agent_hostname, community, base_oid):  # pragma: no cover
                 'snmp response pdu error %r at %r' % (
                     pduErrorIndication,
                     errorIndex and varBinds[int(errorIndex) - 1][0] or '?'))
-        if errorIndex == 0:
+        if errorIndex != 0:
             raise SNMPWalkError(
                 'sanity failure: errorIndex != 0, '
                 'but no error indication')