diff --git a/net/rxrpc/key.c b/net/rxrpc/key.c index fa475b02bdce..16efd04d4a80 100644 --- a/net/rxrpc/key.c +++ b/net/rxrpc/key.c @@ -1106,7 +1106,7 @@ static long rxrpc_read(const struct key *key, default: /* we have a ticket we can't encode */ pr_err("Unsupported key token type (%u)\n", token->security_index); - continue; + return -ENOPKG; } _debug("token[%u]: toksize=%u", ntoks, toksize); @@ -1226,7 +1226,9 @@ static long rxrpc_read(const struct key *key, break; default: - break; + pr_err("Unsupported key token type (%u)\n", + token->security_index); + return -ENOPKG; } ASSERTCMP((unsigned long)xdr - (unsigned long)oldxdr, ==,