Thank you for your contribution! Sashiko AI review found 1 potential issue(s) 
to consider:
- [High] Moving `intel_dmc_init()` before workqueue allocations causes a 
deterministic NULL pointer dereference in `queue_work()` during device probe.
--

commit ae307def86c4a6f405ddfe4fec9bd326757af84d
Author: Lu Yao <[email protected]>
Subject: drm/i915/display: fix error handling in 
intel_display_driver_probe_noirq

This commit modifies the error handling path during display driver probe by
moving the intel_dmc_init call earlier and introducing a cleanup label for
intel_mode_config_init.

> diff --git a/drivers/gpu/drm/i915/display/intel_display_driver.c 
> b/drivers/gpu/drm/i915/display/intel_display_driver.c
> index d0729936f6816..d69bdfb19efe5 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_driver.c
> +++ b/drivers/gpu/drm/i915/display/intel_display_driver.c
> @@ -223,6 +223,8 @@ int intel_display_driver_probe_noirq(struct intel_display 
> *display)
>       if (!HAS_DISPLAY(display))
>               return 0;
>  
> +     intel_dmc_init(display);
> +

[Severity: High]
Does this cause a NULL pointer dereference during device probe?

Looking at intel_dmc_init() in intel_dmc.c, it attempts to queue work on the
unordered workqueue:

void intel_dmc_init(struct intel_display *display)
{
    ...
    queue_work(display->wq.unordered, &dmc->work);
    ...
}

However, display->wq.unordered is allocated further down in this function,
so it appears it will be NULL when intel_dmc_init() is called here.

>       display->hotplug.dp_wq = alloc_ordered_workqueue("intel-dp", 0);
>       if (!display->hotplug.dp_wq) {
>               ret = -ENOMEM;
[ ... ]
> @@ -254,33 +256,31 @@ int intel_display_driver_probe_noirq(struct 
> intel_display *display)
>               goto cleanup_wq_cleanup;
>       }
>  
> -     intel_dmc_init(display);
> -
[ ... ]

-- 
Sashiko AI review ยท 
https://sashiko.dev/#/patchset/[email protected]?part=1

Reply via email to