aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Roper <[email protected]>2023-06-01 10:38:04 -0700
committerMatt Roper <[email protected]>2023-06-05 16:07:06 -0700
commit718551bbed3ca5308a9f9429305dd074727e8d46 (patch)
treea0640db64cf70fbafed581785bdde138dba4a037
parent2d0cdf6020549400d93a3f56f09373ece71c76da (diff)
drm/i915: Fix error handling if driver creation fails during probe
If i915_driver_create() fails to create a valid 'i915' object, we should just disable the PCI device and return immediately without trying to call i915_probe_error() that relies on a valid i915 pointer. Fixes: 12e6f6dc78e4 ("drm/i915/display: Handle GMD_ID identification in display code") Reported-by: Dan Carpenter <[email protected]> Closes: https://lore.kernel.org/all/[email protected]/ Signed-off-by: Matt Roper <[email protected]> Reviewed-by: Gustavo Sousa <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
-rw-r--r--drivers/gpu/drm/i915/i915_driver.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/i915_driver.c b/drivers/gpu/drm/i915/i915_driver.c
index 8e92649124d4..4483be16a00b 100644
--- a/drivers/gpu/drm/i915/i915_driver.c
+++ b/drivers/gpu/drm/i915/i915_driver.c
@@ -762,8 +762,8 @@ int i915_driver_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
i915 = i915_driver_create(pdev, ent);
if (IS_ERR(i915)) {
- ret = PTR_ERR(i915);
- goto out_pci_disable;
+ pci_disable_device(pdev);
+ return PTR_ERR(i915);
}
ret = i915_driver_early_probe(i915);