diff options
author | Ian Moffett <ian@osmora.org> | 2025-10-16 13:42:59 -0400 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2025-10-18 23:24:50 -0400 |
commit | 7e17af1ca7a0f9cb990f83c3e03e379520257683 (patch) | |
tree | edd11ebba29857b897f05711d55bf8e15ccb7a20 /src/sys/os/os_iotap.c | |
parent | 483a2de9971eb31a3a48b475b1e349292e593c41 (diff) |
kern: iotap: Return -ENOTSUP if I/O tap op is NULL
If an I/O tap operation is unimplemented, return the -ENOTSUP error code
before trying to call it.
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'src/sys/os/os_iotap.c')
-rw-r--r-- | src/sys/os/os_iotap.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/sys/os/os_iotap.c b/src/sys/os/os_iotap.c index 238acfe..54d1157 100644 --- a/src/sys/os/os_iotap.c +++ b/src/sys/os/os_iotap.c @@ -130,6 +130,9 @@ iotap_mux(const char *name, struct iotap_msg *msg) ops = desc.ops; switch (msg->opcode) { case IOTAP_OPC_READ: + if (ops->read == NULL) { + return -ENOTSUP; + } return ops->read(&desc, msg->buf, msg->len); } |