diff options
| author | Bill Wendling <morbo@google.com> | 2026-09-22 11:06:01 +0000 |
|---|---|---|
| committer | Brian Masney <bmasney@redhat.com> | 2026-09-24 15:24:57 -0400 |
| commit | a1f2029b89ccd7bef54e187384417db4d72d0a11 (patch) | |
| tree | e2c1fbc5dea1b468e2b51b5d7ac2ce8d6b7448a3 /include/linux/clk | |
| parent | 45a68afbd4b632538a0956ba783fca45b8ceb446 (diff) | |
clk: tegra: annotate struct tegra210_clk_emc_provider with __counted_by_ptr
Annotate the "configs" pointer field of "struct
tegra210_clk_emc_provider" with the "__counted_by_ptr" attribute,
allowing the compiler to perform runtime bounds checking on accesses to
"configs" based on the value of "num_configs".
The "emc->provider.configs = devm_kcalloc(...)" call uses
"emc->num_timings" for the number of elements, which is then assigned to
"emc->provider.num_configs" before any accesses to "configs". The
"num_configs" field isn't modified after assignment.
Cc: codemender-patching+linux@google.com
Assisted-by: LLM
Signed-off-by: Bill Wendling <morbo@google.com>
Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Reviewed-by: Kees Cook <kees@kernel.org>
Signed-off-by: Brian Masney <bmasney@redhat.com>
Diffstat (limited to 'include/linux/clk')
| -rw-r--r-- | include/linux/clk/tegra.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/clk/tegra.h b/include/linux/clk/tegra.h index 3650e926e93f..f1034e14c1a4 100644 --- a/include/linux/clk/tegra.h +++ b/include/linux/clk/tegra.h @@ -170,7 +170,7 @@ struct tegra210_clk_emc_provider { struct module *owner; struct device *dev; - struct tegra210_clk_emc_config *configs; + struct tegra210_clk_emc_config *configs __counted_by_ptr(num_configs); unsigned int num_configs; int (*set_rate)(struct device *dev, |
