Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Leo Yan <leo.yan@arm.com>
To: Yingchao Deng <yingchao.deng@oss.qualcomm.com>
Cc: Suzuki K Poulose <suzuki.poulose@arm.com>,
	Mike Leach <mike.leach@arm.com>,
	James Clark <james.clark@linaro.org>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	jinlong.mao@oss.qualcomm.com, quic_yingdeng@quicinc.com,
	tingwei.zhang@oss.qualcomm.com, jie.gan@oss.qualcomm.com
Subject: Re: [PATCH v9 1/4] coresight: cti: Convert trigger usage fields to dynamic
Date: Thu, 28 May 2026 19:01:29 +0100	[thread overview]
Message-ID: <20260528180129.GJ101133@e132581.arm.com> (raw)
In-Reply-To: <20260521-extended_cti-v9-1-d21f4f92c51e@oss.qualcomm.com>

On Thu, May 21, 2026 at 08:16:27PM +0800, Yingchao Deng wrote:

[...]

> @@ -231,6 +254,8 @@ struct cti_trig_con *cti_allocate_trig_con(struct device *dev, int in_sigs,
>  {
>  	struct cti_trig_con *tc = NULL;
>  	struct cti_trig_grp *in = NULL, *out = NULL;
> +	struct cti_drvdata *drvdata = dev_get_drvdata(dev);
> +	int n_trigs = drvdata->config.nr_trig_max;

I don't mind it allocates bitmask with nr_trig_max, but AI review
suggests that when in_sigs / out_sigs bigger than nr_trig_max, it might
access memory out-of-boundary (see cti_plat_read_trig_group()).

It is good to add a check:

    if (in_sigs > n_trigs || out_sigs > n_trigs) {
        dev_err(dev, "trigger signal is out of range: in=%d out=%d nr_max=%d\n",
                in_sigs, out_sigs, n_trigs\n");
        return NULL;
    }

With this:

Reviewed-by: Leo Yan <leo.yan@arm.com>

BTW, I have given my review tag on v8, please remember to update
patches with review / ack tags.


  reply	other threads:[~2026-05-28 18:01 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-21 12:16 [PATCH v9 0/4] Add Qualcomm extended CTI support Yingchao Deng
2026-05-21 12:16 ` [PATCH v9 1/4] coresight: cti: Convert trigger usage fields to dynamic Yingchao Deng
2026-05-28 18:01   ` Leo Yan [this message]
2026-05-29  1:31     ` Yingchao Deng (Consultant)
2026-05-21 12:16 ` [PATCH v9 2/4] coresight: cti: use __reg_addr() helper for register access Yingchao Deng
2026-05-29 14:40   ` Leo Yan
2026-05-21 12:16 ` [PATCH v9 3/4] coresight: cti: add Qualcomm extended CTI identification and quirks Yingchao Deng
2026-05-22  2:38   ` Jie Gan
2026-05-28 17:11   ` Leo Yan
2026-05-29  1:42     ` Yingchao Deng (Consultant)
2026-05-21 12:16 ` [PATCH v9 4/4] coresight: cti: expose banked sysfs registers for Qualcomm extended CTI Yingchao Deng
2026-05-29 15:32   ` Leo Yan

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=20260528180129.GJ101133@e132581.arm.com \
    --to=leo.yan@arm.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=coresight@lists.linaro.org \
    --cc=james.clark@linaro.org \
    --cc=jie.gan@oss.qualcomm.com \
    --cc=jinlong.mao@oss.qualcomm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mike.leach@arm.com \
    --cc=quic_yingdeng@quicinc.com \
    --cc=suzuki.poulose@arm.com \
    --cc=tingwei.zhang@oss.qualcomm.com \
    --cc=yingchao.deng@oss.qualcomm.com \
    /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