staging: comedi: don't allocate buffer space when polling for write
[platform/kernel/linux-starfive.git] / drivers / staging / comedi / comedi_fops.c
index bd12481..42f6971 100644 (file)
@@ -2287,10 +2287,9 @@ static unsigned int comedi_poll(struct file *file, poll_table *wait)
 
                if (s != s_read)
                        poll_wait(file, &s->async->wait_head, wait);
-               comedi_buf_write_alloc(s, s->async->prealloc_bufsz);
                if (!s->busy || !comedi_is_subdevice_running(s) ||
                    !(s->async->cmd.flags & CMDF_WRITE) ||
-                   comedi_buf_write_n_allocated(s) >= bps)
+                   comedi_buf_write_n_available(s) >= bps)
                        mask |= POLLOUT | POLLWRNORM;
        }