Linux kernel and device drivers for NXP i.MX platforms
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Daniel Baluta" <daniel.baluta@nxp.com>
Cc: Frank.Li@kernel.org, imx@lists.linux.dev
Subject: Re: [PATCH v6 4/4] soc: qcom: ubwc: Fix missing include
Date: Mon, 17 Aug 2026 12:42:31 +0000	[thread overview]
Message-ID: <20260817124231.DAB8B1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260817123542.48475-5-daniel.baluta@nxp.com>

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

Pre-existing issues:
- [High] Missing cleanup in `a5xx_gpu_init()` when `qcom_ubwc_config_get_data()` returns an error, leading to a memory and resource leak.
--

--- Patch [4]: [PATCH v6 4/4] soc: qcom: ubwc: Fix missing include ---
commit 8a6d2fb79b4edaad79d216dc3cc985d7cf39e314
Author: Daniel Baluta <daniel.baluta@nxp.com>

soc: qcom: ubwc: Fix missing include

This commit adds the <linux/err.h> include to ubwc.h to resolve a compilation
error regarding the implicit declaration of ERR_PTR when
CONFIG_QCOM_UBWC_CONFIG=n.

Fixes: 1924272b9ce1 ("soc: qcom: Add UBWC config provider")

> diff --git a/include/linux/soc/qcom/ubwc.h b/include/linux/soc/qcom/ubwc.h
> index a7372d9c25fbc..f3a70360b177b 100644
> --- a/include/linux/soc/qcom/ubwc.h
> +++ b/include/linux/soc/qcom/ubwc.h
> @@ -8,6 +8,7 @@
>  #define __QCOM_UBWC_H__
>  
>  #include <linux/bits.h>
> +#include <linux/err.h>

[Severity: High]
This isn't a bug introduced by this patch, but it brings attention to a
potential memory and resource leak in a5xx_gpu_init() when it calls
qcom_ubwc_config_get_data().

If qcom_ubwc_config_get_data() returns -EPROBE_DEFER (when SMEM is unavailable)
or -EOPNOTSUPP (when CONFIG_QCOM_UBWC_CONFIG=n), the function returns the error
directly without tearing down the initialized GPU resources via a5xx_destroy():

drivers/gpu/drm/msm/adreno/a5xx_gpu.c:a5xx_gpu_init() {
    ...
	/* Inherit the common config and make some necessary fixups */
	adreno_gpu->ubwc_config = qcom_ubwc_config_get_data();
	if (IS_ERR(adreno_gpu->ubwc_config))
		return ERR_CAST(adreno_gpu->ubwc_config);
    ...
}

Because qcom_ubwc_config_get_data() actively returns -EPROBE_DEFER when SMEM
isn't ready, this error path will be taken during standard boot sequences where
SMEM probes after the GPU.

Does this code leak the a5xx_gpu structure and ringbuffers initialized by
adreno_gpu_init() on each deferral?

>  #include <linux/printk.h>
>  #include <linux/types.h>
>

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260817123542.48475-1-daniel.baluta@nxp.com?part=4

  reply	other threads:[~2026-08-17 12:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-17 12:35 [PATCH v6 0/4] soc: qcom: ubwc: Fix link error when QCOM_SMEM=n Daniel Baluta
2026-08-17 12:35 ` [PATCH v6 1/4] drm/msm: Guard the QCOM_UBWC_CONFIG select with QCOM_SMEM Daniel Baluta
2026-08-17 12:41   ` sashiko-bot
2026-08-17 12:35 ` [PATCH v6 2/4] media: iris: " Daniel Baluta
2026-08-17 12:35 ` [PATCH v6 3/4] soc: qcom: ubwc: Fix link error when QCOM_SMEM=n Daniel Baluta
2026-08-17 12:35 ` [PATCH v6 4/4] soc: qcom: ubwc: Fix missing include Daniel Baluta
2026-08-17 12:42   ` sashiko-bot [this message]
2026-08-17 18:17 ` [PATCH v6 0/4] soc: qcom: ubwc: Fix link error when QCOM_SMEM=n Nathan Chancellor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260817124231.DAB8B1F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=Frank.Li@kernel.org \
    --cc=daniel.baluta@nxp.com \
    --cc=imx@lists.linux.dev \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox