Skip to contentSkip to conversation

rxrpc: rxgk: Set error code in rxgk_yfs_decode_ticket()

PATCH In review Dan Carpenter 2 participants 2 messages Apr 16, 2025 – Apr 18, 2025

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rxrpc: rxgk: Set error code in rxgk_yfs_decode_ticket()

Propagate the error code if key_alloc() fails. Don't return success.

Fixes 9d1d2b59341f ("rxrpc: rxgk: Implement the yfs-rxgk security class (GSSAPI)")

---
It's not totally clear if these patch prefixes are real things or just a cat walking across the keyboard. "rxrxpc: gk: yfs-rxgk" Really? We expect people to believe these are real?

---
 net/rxrpc/rxgk_app.c | 1 +
 1 file changed, 1 insertion(+)
net/rxrpc/rxgk_app.c +1 -0
index 6206a84395b8..b94b77a1c317 100644
@@ -141,6 +141,7 @@ int rxgk_yfs_decode_ticket(struct rxrpc_connection *conn, struct sk_buff *skb,
 			KEY_ALLOC_NOT_IN_QUOTA, NULL);
 	if (IS_ERR(key)) {
 		_leave(" = -ENOMEM [alloc %ld]", PTR_ERR(key));
+		ret = PTR_ERR(key);
 		goto error;
 	}
 
Signature · 1 line
2.47.2
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Dan Carpenter

Propagate the error code if key_alloc() fails. Don't return success.

Fixes 9d1d2b59341f ("rxrpc: rxgk: Implement the yfs-rxgk security class (GSSAPI)")

...

net/rxrpc/rxgk_app.c int rxgk_yfs_decode_ticket(struct rxrpc_connection *conn, struct sk_buff *skb, · line 143

Quoted 8 lines
net/rxrpc/rxgk_app.c +0 -0
index 6206a84395b8..b94b77a1c317 100644
@@ -141,6 +141,7 @@ int rxgk_yfs_decode_ticket(struct rxrpc_connection *conn, struct sk_buff *skb,
 			KEY_ALLOC_NOT_IN_QUOTA, NULL);
 	if (IS_ERR(key)) {
 		_leave(" = -ENOMEM [alloc %ld]", PTR_ERR(key));

Not a bug, but it doesn't seem ideal that _leave(), which logs a debug message, is called here and with a more general format in the error label.

Quoted 7 lines
net/rxrpc/rxgk_app.c +1 -0
+		ret = PTR_ERR(key);
 		goto error;
 	}
 
Signature · 1 line
2.47.2