Commit 52f947bb authored by Jan Kiszka's avatar Jan Kiszka Committed by Philippe Gerum
Browse files

cobalt/rtdm: Fix tracing of failed fd operation



Also if some fd operation failed, we trace the result via the
fd_request_status class. However, fd will then contain an error code,
not a valid pointer. Avoid dereferencing such invalid pointers and
causing an oops this way.
Signed-off-by: Jan Kiszka's avatarJan Kiszka <jan.kiszka@siemens.com>
parent 26cc6431
......@@ -75,7 +75,8 @@ DECLARE_EVENT_CLASS(fd_request_status,
TP_fast_assign(
memcpy(__entry->comm, task->comm, TASK_COMM_LEN);
__entry->pid = task->pid;
__entry->dev = rtdm_fd_to_context(fd)->device;
__entry->dev =
!IS_ERR(fd) ? rtdm_fd_to_context(fd)->device : NULL;
__entry->ufd = ufd;
),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment