Skip to content

Commit 718551b

Browse files
committed
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: 12e6f6d ("drm/i915/display: Handle GMD_ID identification in display code") Reported-by: Dan Carpenter <dan.carpenter@linaro.org> Closes: https://lore.kernel.org/all/55236f93-dcc5-481e-b788-9f7e95b129d8@kili.mountain/ Signed-off-by: Matt Roper <matthew.d.roper@intel.com> Reviewed-by: Gustavo Sousa <gustavo.sousa@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230601173804.557756-1-matthew.d.roper@intel.com
1 parent 2d0cdf6 commit 718551b

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/gpu/drm/i915/i915_driver.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -762,8 +762,8 @@ int i915_driver_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
762762

763763
i915 = i915_driver_create(pdev, ent);
764764
if (IS_ERR(i915)) {
765-
ret = PTR_ERR(i915);
766-
goto out_pci_disable;
765+
pci_disable_device(pdev);
766+
return PTR_ERR(i915);
767767
}
768768

769769
ret = i915_driver_early_probe(i915);

0 commit comments

Comments
 (0)