summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/pci.c
diff options
context:
space:
mode:
authorAlex Waterman <alexw@nvidia.com>2016-09-22 19:01:23 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2016-10-31 13:34:04 -0400
commit9dce41e208818c0084c91685c8255942a2ca6e8d (patch)
tree77a536beb07b6d9855433714577e1aa6a779394f /drivers/gpu/nvgpu/pci.c
parent4c2e65c60bdb6ba20f3a597a078eda36989aaa59 (diff)
gpu: nvgpu: Only set mode if ptr is valid
In the nvgpu_pci_devnode() function only set the mode if the mode pointer is valid. In some cases this function only needs the name of the node and not its permissions. Bug 1816516 Change-Id: I603c1499083fb29cb5fe4a871068e0bf2cbe9c3d Signed-off-by: Alex Waterman <alexw@nvidia.com> Reviewed-on: http://git-master/r/1225614 (cherry picked from commit 11874ad9df49b44fac4e90d83e138ead63bbb2f9) Reviewed-on: http://git-master/r/1244907 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/pci.c')
-rw-r--r--drivers/gpu/nvgpu/pci.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/pci.c b/drivers/gpu/nvgpu/pci.c
index 3679e0c8..3c46f073 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)
197 197
198static char *nvgpu_pci_devnode(struct device *dev, umode_t *mode) 198static char *nvgpu_pci_devnode(struct device *dev, umode_t *mode)
199{ 199{
200 *mode = S_IRUGO | S_IWUGO; 200 if (mode)
201 *mode = S_IRUGO | S_IWUGO;
201 return kasprintf(GFP_KERNEL, "nvgpu-pci/%s", dev_name(dev)); 202 return kasprintf(GFP_KERNEL, "nvgpu-pci/%s", dev_name(dev));
202} 203}
203 204