Skip to content

Commit 90ffff5

Browse files
harshimogalapallivijay-suman
authored andcommitted
net/rds: Fix a NULL dereference in rds_tcp_accept_one()
At the beginning of rds_tcp_accept_one(), when sock is NULL it goes to label "out" where sock is dereferenced "sock->sk" so it is a NULL dereference. Add a NULL check to avoid NULL dereference. Orabug: 34371883 Fixes: 1031d5d9f25e ("rds: tcp transport-specific tracepoints") Signed-off-by: Harshit Mogalapalli <[email protected]> Reviewed-by: Gerd Rausch <[email protected]>
1 parent dfeefe4 commit 90ffff5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

net/rds/tcp_listen.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,8 @@ int rds_tcp_accept_one(struct socket *sock)
238238
ret = 0;
239239
out:
240240
if (ret)
241-
trace_rds_tcp_accept_err(conn, cp, rs_tcp, sock->sk, reason,
242-
ret);
241+
trace_rds_tcp_accept_err(conn, cp, rs_tcp,
242+
sock ? sock->sk : NULL, reason, ret);
243243
else
244244
trace_rds_tcp_accept(conn, cp, rs_tcp, sock->sk, "accept", ret);
245245
if (rs_tcp)

0 commit comments

Comments
 (0)