diff options
| author | Alexey Kardashevskiy <aik@ozlabs.ru> | 2013-06-05 10:54:16 -0400 |
|---|---|---|
| committer | Alex Williamson <alex.williamson@redhat.com> | 2013-06-05 10:54:16 -0400 |
| commit | 9a6aa279d3d17af73a029fa40654e92f4e75e8bb (patch) | |
| tree | 25e81385f50cb6f4b2984d30522683d8a049c622 | |
| parent | d683b96b072dc4680fc74964eca77e6a23d1fa6e (diff) | |
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: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
| -rw-r--r-- | drivers/vfio/vfio.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/vfio/vfio.c b/drivers/vfio/vfio.c index acb7121a9316..6d78736563de 100644 --- a/drivers/vfio/vfio.c +++ b/drivers/vfio/vfio.c | |||
| @@ -1360,7 +1360,7 @@ static const struct file_operations vfio_device_fops = { | |||
| 1360 | */ | 1360 | */ |
| 1361 | static char *vfio_devnode(struct device *dev, umode_t *mode) | 1361 | static char *vfio_devnode(struct device *dev, umode_t *mode) |
| 1362 | { | 1362 | { |
| 1363 | if (MINOR(dev->devt) == 0) | 1363 | if (mode && (MINOR(dev->devt) == 0)) |
| 1364 | *mode = S_IRUGO | S_IWUGO; | 1364 | *mode = S_IRUGO | S_IWUGO; |
| 1365 | 1365 | ||
| 1366 | return kasprintf(GFP_KERNEL, "vfio/%s", dev_name(dev)); | 1366 | return kasprintf(GFP_KERNEL, "vfio/%s", dev_name(dev)); |
