diff options
| author | David Carlier <devnexen@gmail.com> | 2026-04-07 18:07:58 +0300 |
|---|---|---|
| committer | Jakub Kicinski <kuba@kernel.org> | 2026-04-10 05:27:43 +0300 |
| commit | 9addea5d44b69d377ba97a36f7a19e1097969e18 (patch) | |
| tree | 361e94c939b7df333f29d141e26526ed7d42a5aa /net/tipc/node.c | |
| parent | 581d28606cdd51c5da06330e8fb97476503cd74d (diff) | |
| download | linux-9addea5d44b69d377ba97a36f7a19e1097969e18.tar.xz | |
net: use get_random_u{16,32,64}() where appropriate
Use the typed random integer helpers instead of
get_random_bytes() when filling a single integer variable.
The helpers return the value directly, require no pointer
or size argument, and better express intent.
Skipped sites writing into __be16 (netdevsim) and __le64
(ceph) fields where a direct assignment would trigger
sparse endianness warnings.
Signed-off-by: David Carlier <devnexen@gmail.com>
Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Link: https://patch.msgid.link/20260407150758.5889-1-devnexen@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/tipc/node.c')
| -rw-r--r-- | net/tipc/node.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/tipc/node.c b/net/tipc/node.c index af442a5ef8f3..97aa970a0d83 100644 --- a/net/tipc/node.c +++ b/net/tipc/node.c @@ -1275,7 +1275,7 @@ void tipc_node_check_dest(struct net *net, u32 addr, goto exit; if_name = strchr(b->name, ':') + 1; - get_random_bytes(&session, sizeof(u16)); + session = get_random_u16(); if (!tipc_link_create(net, if_name, b->identity, b->tolerance, b->net_plane, b->mtu, b->priority, b->min_win, b->max_win, session, |
