Skip to content

Commit 370dfe0

Browse files
rluboscarlescufi
authored andcommitted
net: sockets: Fix socket ctx check in usermode
When `z_get_fd_obj_and_vtable()` function returns NULL (no valid entry in the FD table for the socket), there is no need for further usermode checks on the `ctx` pointer, as there is nothing to invalidate in that case. Fixes #25990 Fixes #25991 Signed-off-by: Robert Lubos <[email protected]>
1 parent 1af0428 commit 370dfe0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

subsys/net/lib/sockets/sockets.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ static inline void *get_sock_vtable(
5151
(const struct fd_op_vtable **)vtable);
5252

5353
#ifdef CONFIG_USERSPACE
54-
if (z_is_in_user_syscall()) {
54+
if (ctx != NULL && z_is_in_user_syscall()) {
5555
struct z_object *zo;
5656
int ret;
5757

0 commit comments

Comments
 (0)