Skip to content

Commit c3213d2

Browse files
scottmayhewJ. Bruce Fields
authored andcommitted
SUNRPC: Fix oops in the rpc_xdr_buf event class
Backchannel rpc tasks don't have task->tk_client set, so it's necessary to check it for NULL before dereferencing. Fixes: c509f15 ("SUNRPC: Split the xdr_buf event class") Signed-off-by: Scott Mayhew <smayhew@redhat.com> Reviewed-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
1 parent ae29750 commit c3213d2

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

include/trace/events/sunrpc.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ DECLARE_EVENT_CLASS(rpc_xdr_buf_class,
6868

6969
TP_fast_assign(
7070
__entry->task_id = task->tk_pid;
71-
__entry->client_id = task->tk_client->cl_clid;
71+
__entry->client_id = task->tk_client ?
72+
task->tk_client->cl_clid : -1;
7273
__entry->head_base = xdr->head[0].iov_base;
7374
__entry->head_len = xdr->head[0].iov_len;
7475
__entry->tail_base = xdr->tail[0].iov_base;

0 commit comments

Comments
 (0)