Skip to content

Commit 9f63a0a

Browse files
Andrew Boiecarlescufi
authored andcommitted
net: lib: remove socket-specific recycle calls
This is just done in common code now. Signed-off-by: Andrew Boie <[email protected]>
1 parent 87480cd commit 9f63a0a

File tree

5 files changed

+0
-41
lines changed

5 files changed

+0
-41
lines changed

subsys/net/lib/sockets/sockets_can.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,6 @@ int zcan_socket(int family, int type, int proto)
7171

7272
k_fifo_init(&ctx->recv_q);
7373

74-
#ifdef CONFIG_USERSPACE
75-
/* Set net context object as initialized and grant access to the
76-
* calling thread (and only the calling thread)
77-
*/
78-
z_object_recycle(ctx);
79-
#endif
80-
8174
z_finalize_fd(fd, ctx,
8275
(const struct fd_op_vtable *)&can_sock_fd_op_vtable);
8376

subsys/net/lib/sockets/sockets_net_mgmt.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,6 @@ int znet_mgmt_socket(int family, int type, int proto)
8080
mgmt->alloc_timeout = MSG_ALLOC_TIMEOUT;
8181
mgmt->wait_timeout = K_FOREVER;
8282

83-
#if defined(CONFIG_USERSPACE)
84-
/* Set net context object as initialized and grant access to the
85-
* calling thread (and only the calling thread)
86-
*/
87-
z_object_recycle(mgmt);
88-
#endif
89-
9083
z_finalize_fd(fd, mgmt,
9184
(const struct fd_op_vtable *)&net_mgmt_sock_fd_op_vtable);
9285

subsys/net/lib/sockets/sockets_packet.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,6 @@ static int zpacket_socket(int family, int type, int proto)
6868

6969
/* recv_q and accept_q are in union */
7070
k_fifo_init(&ctx->recv_q);
71-
72-
#ifdef CONFIG_USERSPACE
73-
/* Set net context object as initialized and grant access to the
74-
* calling thread (and only the calling thread)
75-
*/
76-
z_object_recycle(ctx);
77-
#endif
78-
7971
z_finalize_fd(fd, ctx,
8072
(const struct fd_op_vtable *)&packet_sock_fd_op_vtable);
8173

subsys/net/lib/sockets/sockets_tls.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1159,13 +1159,6 @@ static int ztls_socket(int family, int type, int proto)
11591159
/* recv_q and accept_q are in union */
11601160
k_fifo_init(&ctx->recv_q);
11611161

1162-
#ifdef CONFIG_USERSPACE
1163-
/* Set net context object as initialized and grant access to the
1164-
* calling thread (and only the calling thread)
1165-
*/
1166-
z_object_recycle(ctx);
1167-
#endif
1168-
11691162
if (tls_proto != 0) {
11701163
/* If TLS protocol is used, allocate TLS context */
11711164
ctx->tls = tls_alloc();
@@ -1285,10 +1278,6 @@ int ztls_accept_ctx(struct net_context *parent, struct sockaddr *addr,
12851278

12861279
child = k_fifo_get(&parent->accept_q, K_FOREVER);
12871280

1288-
#ifdef CONFIG_USERSPACE
1289-
z_object_recycle(child);
1290-
#endif
1291-
12921281
if (addr != NULL && addrlen != NULL) {
12931282
int len = MIN(*addrlen, sizeof(child->remote));
12941283

subsys/net/lib/websocket/websocket.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -364,14 +364,6 @@ int websocket_connect(int sock, struct websocket_request *wreq,
364364
}
365365

366366
ctx->sock = fd;
367-
368-
#ifdef CONFIG_USERSPACE
369-
/* Set net context object as initialized and grant access to the
370-
* calling thread (and only the calling thread)
371-
*/
372-
z_object_recycle(ctx);
373-
#endif
374-
375367
z_finalize_fd(fd, ctx,
376368
(const struct fd_op_vtable *)&websocket_fd_op_vtable);
377369

0 commit comments

Comments
 (0)