Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9a6aa279 authored by Alexey Kardashevskiy's avatar Alexey Kardashevskiy Committed by Alex Williamson
Browse files

vfio: fix crash on rmmod



devtmpfs_delete_node() calls devnode() callback with mode==NULL but
vfio still tries to write there.

The patch fixes this.

Signed-off-by: default avatarAlexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: default avatarAlex Williamson <alex.williamson@redhat.com>
parent d683b96b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1360,7 +1360,7 @@ static const struct file_operations vfio_device_fops = {
 */
static char *vfio_devnode(struct device *dev, umode_t *mode)
{
	if (MINOR(dev->devt) == 0)
	if (mode && (MINOR(dev->devt) == 0))
		*mode = S_IRUGO | S_IWUGO;

	return kasprintf(GFP_KERNEL, "vfio/%s", dev_name(dev));