Fix: LTTNG_KERNEL_ADD_CALLSITE: Handle unknown event type
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 18 Oct 2019 19:23:59 +0000 (15:23 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 18 Oct 2019 19:23:59 +0000 (15:23 -0400)
Return -ENOSYS for unknown event type (similarly to other commands)
rather than falling-through the switch statement.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
lttng-abi.c

index d9e85dc21283c6e49a5ef3c527314e25b533be78..5c6f384d8fc62c6b40a229a30d9036a0be9f3f9e 100644 (file)
@@ -1567,6 +1567,9 @@ long lttng_event_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
                                (struct lttng_kernel_event_callsite __user *) arg);
                case LTTNG_TYPE_ENABLER:
                        return -EINVAL;
+               default:
+                       WARN_ON_ONCE(1);
+                       return -ENOSYS;
                }
        default:
                return -ENOIOCTLCMD;
This page took 0.026922 seconds and 4 git commands to generate.