diff options
author | Scott Mayhew <smayhew@redhat.com> | 2020-11-12 15:17:32 -0500 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2020-11-12 15:56:51 -0500 |
commit | c3213d260a23e263ef85ba21ac68c9e7578020b5 (patch) | |
tree | f794ea412f964cd55338db0fe45015a5f20f3bb8 /include/trace/events/sunrpc.h | |
parent | ae2975046dbc65855c217fe6fbd5b33140c5ff18 (diff) |
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: c509f15a5801 ("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>
Diffstat (limited to 'include/trace/events/sunrpc.h')
-rw-r--r-- | include/trace/events/sunrpc.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/trace/events/sunrpc.h b/include/trace/events/sunrpc.h index 2477014e3fa6..2a03263b5f9d 100644 --- a/include/trace/events/sunrpc.h +++ b/include/trace/events/sunrpc.h @@ -68,7 +68,8 @@ DECLARE_EVENT_CLASS(rpc_xdr_buf_class, TP_fast_assign( __entry->task_id = task->tk_pid; - __entry->client_id = task->tk_client->cl_clid; + __entry->client_id = task->tk_client ? + task->tk_client->cl_clid : -1; __entry->head_base = xdr->head[0].iov_base; __entry->head_len = xdr->head[0].iov_len; __entry->tail_base = xdr->tail[0].iov_base; |