diff --git a/drivers/gpu/nvgpu/pci.c b/drivers/gpu/nvgpu/pci.c index 3679e0c84..3c46f0731 100644 --- a/drivers/gpu/nvgpu/pci.c +++ b/drivers/gpu/nvgpu/pci.c @@ -197,7 +197,8 @@ static int nvgpu_pci_init_support(struct pci_dev *pdev) static char *nvgpu_pci_devnode(struct device *dev, umode_t *mode) { - *mode = S_IRUGO | S_IWUGO; + if (mode) + *mode = S_IRUGO | S_IWUGO; return kasprintf(GFP_KERNEL, "nvgpu-pci/%s", dev_name(dev)); }