Thank you for your contribution! Sashiko AI review found 1 potential issue(s) 
to consider:

Pre-existing issues:
- [High] Potential NULL pointer dereference in 
`hvdrm_crtc_helper_atomic_enable` when accessing `plane_state->fb->pitches`.
--

commit 9e40bbf4c669c839b0568d52b603d410d08dde6c
Author: Michael Kelley <[email protected]>
drm/hyperv: Replace "hyperv_" with "hvdrm_" as symbol name prefix

This commit mechanically replaces the "hyperv_" prefix with "hvdrm_" across
functions and structures in the Hyper-V DRM driver. This renaming prevents
namespace collisions with core Hyper-V and VMBus code, and addresses an
initcall conflict that prevents using initcall_blacklist.

> diff --git a/drivers/gpu/drm/hyperv/hyperv_drm_modeset.c 
> b/drivers/gpu/drm/hyperv/hyperv_drm_modeset.c
> --- a/drivers/gpu/drm/hyperv/hyperv_drm_modeset.c
> +++ b/drivers/gpu/drm/hyperv/hyperv_drm_modeset.c
[ ... ]
> @@ -107,14 +107,14 @@ static const uint64_t hyperv_modifiers[] = {
> -static void hyperv_crtc_helper_atomic_enable(struct drm_crtc *crtc,
> +static void hvdrm_crtc_helper_atomic_enable(struct drm_crtc *crtc,
>                                            struct drm_atomic_commit *state)
>  {
> -     struct hyperv_drm_device *hv = to_hv(crtc->dev);
> +     struct hvdrm_drm_device *hv = to_hv(crtc->dev);
>       struct drm_plane *plane = &hv->plane;
>       struct drm_plane_state *plane_state = plane->state;
>       struct drm_crtc_state *crtc_state = crtc->state;
>  
> -     hyperv_hide_hw_ptr(hv->hdev);
> -     hyperv_update_situation(hv->hdev, 1,  hv->screen_depth,
> +     hvdrm_hide_hw_ptr(hv->hdev);
> +     hvdrm_update_situation(hv->hdev, 1,  hv->screen_depth,
>                               crtc_state->mode.hdisplay,
>                               crtc_state->mode.vdisplay,
>                               plane_state->fb->pitches[0]);

[Severity: High]
This is a pre-existing issue, but could this cause a NULL pointer
dereference?

In the DRM atomic API, userspace can configure a CRTC to be active without an
attached framebuffer on its primary plane, which means plane_state->fb can be
NULL.

If the CRTC is enabled while the primary plane lacks a framebuffer, it looks
like dereferencing plane_state->fb->pitches[0] here will crash the kernel.

>  
>       drm_crtc_vblank_on(crtc);
>  }

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

Reply via email to