tracing/user_events: Fix incorrect return value for writing operation when events...
[platform/kernel/linux-rpi.git] / kernel / trace / trace_events_user.c
index 8df0550..09f7d91 100644 (file)
@@ -2096,7 +2096,8 @@ static ssize_t user_events_write_core(struct file *file, struct iov_iter *i)
 
                if (unlikely(faulted))
                        return -EFAULT;
-       }
+       } else
+               return -EBADF;
 
        return ret;
 }