Skip to contentSkip to conversation

net: dovetail: Pick up lost return code of packet_do_bind_unlocked

PATCH Applied Jan Kiszka 2 participants 2 messages Nov 11

Subsystems (2)
lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

PATCH 1/1 net: dovetail: Pick up lost return code of packet_do_bind_unlocked

From: Jan Kiszka <[email protected]>

Results in missed errors and uninitialized usage of ret, thus random behavior.

Reported-by opencode:Opus-5.5

---

Apparently a regression of the 6.19 forward port.

 net/packet/af_packet.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/packet/af_packet.c +1 -1
index 6ebeb3f1f5811..53b1c35423699 100644
@@ -3371,7 +3371,7 @@ static int packet_bind_spkt(struct socket *sock, struct sockaddr_unsized *uaddr,
 	name[sizeof(sa->sa_data)] = 0;
 
 	lock_sock(sk);
-	packet_do_bind_unlocked(sk, name, 0, 0);
+	ret = packet_do_bind_unlocked(sk, name, 0, 0);
 	if (!ret && sock_oob_capable(sk->sk_socket))
 		ret = sock_oob_bind(sk, uaddr, addr_len);
 	release_sock(sk);
Signature · 1 line
2.47.3
#1 lore raw
Quoted 19 lines · Jan Kiszka

From: Jan Kiszka <[email protected]>

Results in missed errors and uninitialized usage of ret, thus random behavior.

Reported-by opencode:Opus-5.5

---

Apparently a regression of the 6.19 forward port.

 net/packet/af_packet.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/packet/af_packet.c +0 -0
index 6ebeb3f1f5811..53b1c35423699 100644

net/packet/af_packet.c static int packet_bind_spkt(struct socket *sock, struct sockaddr_unsized *uaddr, · line 3377

Quoted 8 lines
net/packet/af_packet.c +1 -1
@@ -3371,7 +3371,7 @@ static int packet_bind_spkt(struct socket *sock, struct sockaddr_unsized *uaddr,
 	name[sizeof(sa->sa_data)] = 0;
 
 	lock_sock(sk);
-	packet_do_bind_unlocked(sk, name, 0, 0);
+	ret = packet_do_bind_unlocked(sk, name, 0, 0);
 	if (!ret && sock_oob_capable(sk->sk_socket))
 		ret = sock_oob_bind(sk, uaddr, addr_len);
 	release_sock(sk);

Merged, thanks.

Signature · 1 line
Philippe.