diff options
| author | Santhosh Kumar K <s-k6@ti.com> | 2026-05-27 23:07:36 +0530 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2026-05-28 13:49:00 +0100 |
| commit | 79378db6a86c7014cce40b65252e6c18f5b8bcc2 (patch) | |
| tree | 74dcdd5a8cf386a8c421031ffacbb011f8f53496 /arch/score | |
| parent | 60474437af5fe12abd20607766c809e0ad4e7245 (diff) | |
| download | lwn-79378db6a86c7014cce40b65252e6c18f5b8bcc2.tar.gz lwn-79378db6a86c7014cce40b65252e6c18f5b8bcc2.zip | |
spi: spi-mem: avoid mutating op template in spi_mem_supports_op()
spi_mem_supports_op() accepts a const struct spi_mem_op pointer but
casts away const internally to call spi_mem_adjust_op_freq(). This
mutates the caller's op template, which causes stale max_freq values
when callers reuse persistent templates - subsequent calls won't
re-apply the device frequency cap since spi_mem_adjust_op_freq()
skips non-zero values.
Fix by operating on a stack-local copy instead.
Fixes: a4f8e70d75dd ("spi: spi-mem: add spi_mem_adjust_op_freq() in spi_mem_supports_op()")
Cc: Tianyu Xu <xtydtc@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Santhosh Kumar K <s-k6@ti.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://patch.msgid.link/20260527173736.2243004-1-s-k6@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'arch/score')
0 files changed, 0 insertions, 0 deletions
