diff options
Diffstat (limited to 'drivers/gpu/nvgpu/pci.c')
-rw-r--r-- | drivers/gpu/nvgpu/pci.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/gpu/nvgpu/pci.c b/drivers/gpu/nvgpu/pci.c index 0ed621ce..1e66b7c9 100644 --- a/drivers/gpu/nvgpu/pci.c +++ b/drivers/gpu/nvgpu/pci.c | |||
@@ -337,7 +337,7 @@ static int nvgpu_pci_probe(struct pci_dev *pdev, | |||
337 | struct gk20a_platform *platform = NULL; | 337 | struct gk20a_platform *platform = NULL; |
338 | struct gk20a *g; | 338 | struct gk20a *g; |
339 | int err; | 339 | int err; |
340 | char *nodefmt; | 340 | char nodefmt[64]; |
341 | 341 | ||
342 | /* make sure driver_data is a sane index */ | 342 | /* make sure driver_data is a sane index */ |
343 | if (pent->driver_data >= sizeof(nvgpu_pci_device) / | 343 | if (pent->driver_data >= sizeof(nvgpu_pci_device) / |
@@ -410,17 +410,13 @@ static int nvgpu_pci_probe(struct pci_dev *pdev, | |||
410 | return -EINVAL; | 410 | return -EINVAL; |
411 | } | 411 | } |
412 | 412 | ||
413 | nodefmt = kasprintf(GFP_KERNEL, PCI_INTERFACE_NAME, dev_name(&pdev->dev)); | 413 | snprintf(nodefmt, sizeof(nodefmt), |
414 | if (!nodefmt) | 414 | PCI_INTERFACE_NAME, dev_name(&pdev->dev)); |
415 | return -ENOMEM; | ||
416 | 415 | ||
417 | err = nvgpu_probe(g, "gpu_pci", nodefmt, &nvgpu_pci_class); | 416 | err = nvgpu_probe(g, "gpu_pci", nodefmt, &nvgpu_pci_class); |
418 | if (err) | 417 | if (err) |
419 | return err; | 418 | return err; |
420 | 419 | ||
421 | kfree(nodefmt); | ||
422 | nodefmt = NULL; | ||
423 | |||
424 | err = nvgpu_pci_pm_init(&pdev->dev); | 420 | err = nvgpu_pci_pm_init(&pdev->dev); |
425 | if (err) { | 421 | if (err) { |
426 | gk20a_err(&pdev->dev, "pm init failed"); | 422 | gk20a_err(&pdev->dev, "pm init failed"); |