rxrpc: Fix error when reading rxrpc tokens
authorMarc Dionne <marc.dionne@auristor.com>
Fri, 21 Apr 2023 16:16:17 +0000 (17:16 +0100)
committerDavid S. Miller <davem@davemloft.net>
Sun, 23 Apr 2023 12:38:28 +0000 (13:38 +0100)
When converting from ASSERTCMP to WARN_ON, the tested condition must
be inverted, which was missed for this case.

This would cause an EIO error when trying to read an rxrpc token, for
instance when trying to display tokens with AuriStor's "tokens" command.

Fixes: 84924aac08a4 ("rxrpc: Fix checker warning")
Signed-off-by: Marc Dionne <marc.dionne@auristor.com>
Signed-off-by: David Howells <dhowells@redhat.com>
cc: "David S. Miller" <davem@davemloft.net>
cc: Eric Dumazet <edumazet@google.com>
cc: Jakub Kicinski <kuba@kernel.org>
cc: Paolo Abeni <pabeni@redhat.com>
cc: linux-afs@lists.infradead.org
cc: netdev@vger.kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
net/rxrpc/key.c

index 8d53aded09c4268d8297fa23d1125173e06303f6..33e8302a79e3315eb4ebb9ea856ba1901544683d 100644 (file)
@@ -680,7 +680,7 @@ static long rxrpc_read(const struct key *key,
                        return -ENOPKG;
                }
 
-               if (WARN_ON((unsigned long)xdr - (unsigned long)oldxdr ==
+               if (WARN_ON((unsigned long)xdr - (unsigned long)oldxdr !=
                            toksize))
                        return -EIO;
        }