--- x/drivers/comedi/comedi_fops.c +++ y/drivers/comedi/comedi_fops.c @@ -2454,7 +2454,7 @@ static __poll_t comedi_poll(struct file struct comedi_device *dev = cfp->dev; struct comedi_subdevice *s, *s_read; - down_read(&dev->attach_lock); + down_write(&dev->attach_lock); if (!dev->attached) { dev_dbg(dev->class_dev, "no driver attached\n"); @@ -2484,7 +2484,7 @@ static __poll_t comedi_poll(struct file } done: - up_read(&dev->attach_lock); + up_write(&dev->attach_lock); return mask; }