Update version to 2.0.0-rc2
[lttng-modules.git] / lib / ringbuffer / ring_buffer_vfs.c
index 60d69a929b816a8c0db1a0216688b6e73fb527d2..51d8a4d4305bb0dd53d61688d2859a54979e63fb 100644 (file)
@@ -42,6 +42,9 @@ int lib_ring_buffer_open(struct inode *inode, struct file *file)
        struct lib_ring_buffer *buf = inode->i_private;
        int ret;
 
+       if (!buf)
+               return -EINVAL;
+
        ret = lib_ring_buffer_open_read(buf);
        if (ret)
                return ret;
@@ -85,7 +88,7 @@ unsigned int lib_ring_buffer_poll(struct file *filp, poll_table *wait)
        unsigned int mask = 0;
        struct lib_ring_buffer *buf = filp->private_data;
        struct channel *chan = buf->backend.chan;
-       const struct lib_ring_buffer_config *config = chan->backend.config;
+       const struct lib_ring_buffer_config *config = &chan->backend.config;
        int finalized, disabled;
 
        if (filp->f_mode & FMODE_READ) {
@@ -162,7 +165,7 @@ long lib_ring_buffer_ioctl(struct file *filp, unsigned int cmd, unsigned long ar
 {
        struct lib_ring_buffer *buf = filp->private_data;
        struct channel *chan = buf->backend.chan;
-       const struct lib_ring_buffer_config *config = chan->backend.config;
+       const struct lib_ring_buffer_config *config = &chan->backend.config;
 
        if (lib_ring_buffer_channel_is_disabled(chan))
                return -EIO;
@@ -259,7 +262,7 @@ long lib_ring_buffer_compat_ioctl(struct file *filp, unsigned int cmd,
 {
        struct lib_ring_buffer *buf = filp->private_data;
        struct channel *chan = buf->backend.chan;
-       const struct lib_ring_buffer_config *config = chan->backend.config;
+       const struct lib_ring_buffer_config *config = &chan->backend.config;
 
        if (lib_ring_buffer_channel_is_disabled(chan))
                return -EIO;
@@ -368,6 +371,7 @@ long lib_ring_buffer_compat_ioctl(struct file *filp, unsigned int cmd,
 #endif
 
 const struct file_operations lib_ring_buffer_file_operations = {
+       .owner = THIS_MODULE,
        .open = lib_ring_buffer_open,
        .release = lib_ring_buffer_release,
        .poll = lib_ring_buffer_poll,
This page took 0.023844 seconds and 4 git commands to generate.