Thank you for your contribution! Sashiko AI review found 1 potential issue(s) 
to consider:
- [Medium] Missing `of_node_put()` causes an OF node reference leak in 
`msm_separate_gpu_kms_components()`.
--

commit 46360e93ded31d3fb12ccb01a8d959a4c7390270
Author: Mahadevan P <[email protected]>

drm/msm: default separate_gpu_kms to auto selection

This commit updates the separate_gpu_kms module parameter to a tristate,
defaulting to an auto-selection mode. It allows the driver to automatically
split the display and GPU devices depending on the hardware topology,
improving support for multi-display platforms.

Link: 
https://lore.kernel.org/r/[email protected]

> diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c
> --- a/drivers/gpu/drm/msm/msm_drv.c
> +++ b/drivers/gpu/drm/msm/msm_drv.c
[ ... ]
> +bool msm_separate_gpu_kms_components(void)
>  {
> -     return separate_gpu_kms;
> +     struct device_node *np;
> +
> +     np = of_find_matching_node(NULL, msm_gpu_match);
> +     if (!msm_gpu_node_present(np))
> +             return true;
> +     if (separate_gpu_kms == 1)
> +             return true;
> +     if (separate_gpu_kms == 0)
> +             return false;
> +     return msm_separate_gpu_kms_auto();

[Severity: Medium]
Does this code leak the device node reference in
msm_separate_gpu_kms_components() in drivers/gpu/drm/msm/msm_drv.c?

The of_find_matching_node() function returns a node with its reference
count incremented. When np is not NULL, the function returns through
multiple paths without calling of_node_put() to release the reference.

>  }
>  
>  static int msm_drm_uninit(struct device *dev, const struct component_ops 
> *gpu_ops)

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

Reply via email to