[net] rxrpc: Fix error when reading rxrpc tokens

Message ID 212125.1682093777@warthog.procyon.org.uk
State New
Headers
Series [net] rxrpc: Fix error when reading rxrpc tokens |

Commit Message

David Howells April 21, 2023, 4:16 p.m. UTC
  From: Marc Dionne <marc.dionne@auristor.com>

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
---
 net/rxrpc/key.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

patchwork-bot+netdevbpf@kernel.org April 23, 2023, 12:50 p.m. UTC | #1
Hello:

This patch was applied to netdev/net.git (main)
by David S. Miller <davem@davemloft.net>:

On Fri, 21 Apr 2023 17:16:17 +0100 you wrote:
> From: Marc Dionne <marc.dionne@auristor.com>
> 
> 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.
> 
> [...]

Here is the summary with links:
  - [net] rxrpc: Fix error when reading rxrpc tokens
    https://git.kernel.org/netdev/net/c/fadfc57cc804

You are awesome, thank you!
  

Patch

diff --git a/net/rxrpc/key.c b/net/rxrpc/key.c
index 8d53aded09c4..33e8302a79e3 100644
--- a/net/rxrpc/key.c
+++ b/net/rxrpc/key.c
@@ -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;
 	}