mirror of
https://github.com/team-infusion-developers/android_kernel_samsung_msm8976.git
synced 2024-11-07 04:09:21 +00:00
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>
This commit is contained in:
parent
d683b96b07
commit
9a6aa279d3
1 changed files with 1 additions and 1 deletions
|
@ -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));
|
||||
|
|
Loading…
Reference in a new issue