… > +++ b/drivers/iio/industrialio-buffer.c … > static int iio_buffer_chrdev_release(struct inode *inode, struct file *filep) > { … > wake_up(&buffer->pollq); > > + mutex_lock(&buffer->dmabufs_mutex); > + > + /* Close all attached DMABUFs */ … > + mutex_unlock(&buffer->dmabufs_mutex); > + > kfree(ib); … Would you become interested to apply a statement like “guard(mutex)(&buffer->dmabufs_mutex);”? https://elixir.bootlin.com/linux/v6.10-rc3/source/include/linux/mutex.h#L196 Regards, Markus