mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] vgaarb: Stop complaining about absent devices
@ 2015-05-08 10:47 Thierry Reding
  0 siblings, 0 replies; only message in thread
From: Thierry Reding @ 2015-05-08 10:47 UTC (permalink / raw)
  To: David Airlie; +Cc: dri-devel, linux-kernel

From: Thierry Reding <treding@nvidia.com>

Some setups do not register a default VGA device, in which case the VGA
arbiter will still complain about the (non-existent) PCI device being a
non-VGA device.

Fix this by making the error message conditional on a default VGA device
having been set up. Note that the easy route of erroring out early isn't
going to work because otherwise priv->target won't be properly updated.

Signed-off-by: Thierry Reding <treding@nvidia.com>
---
 drivers/gpu/vga/vgaarb.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/vga/vgaarb.c b/drivers/gpu/vga/vgaarb.c
index 7bcbf863656e..3b1e65b3d454 100644
--- a/drivers/gpu/vga/vgaarb.c
+++ b/drivers/gpu/vga/vgaarb.c
@@ -1091,8 +1091,11 @@ static ssize_t vga_arb_write(struct file *file, const char __user * buf,
 		vgadev = vgadev_find(pdev);
 		pr_debug("vgaarb: vgadev %p\n", vgadev);
 		if (vgadev == NULL) {
-			pr_err("vgaarb: this pci device is not a vga device\n");
-			pci_dev_put(pdev);
+			if (pdev) {
+				pr_err("vgaarb: this pci device is not a vga device\n");
+				pci_dev_put(pdev);
+			}
+
 			ret_val = -ENODEV;
 			goto done;
 		}
-- 
2.3.5


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-05-08 10:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-08 10:47 [PATCH] vgaarb: Stop complaining about absent devices Thierry Reding

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®