summaryrefslogtreecommitdiff
path: root/rust/helpers/platform.c
diff options
context:
space:
mode:
authorStephan Gerhold <stephan.gerhold@linaro.org>2025-08-18 11:50:41 +0200
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2025-09-09 15:59:20 +0200
commit57429b0fddfe3cea21a56326576451a4a4c2019b (patch)
tree59c9823bd67878eb554511239826abdfc249db65 /rust/helpers/platform.c
parentdbd57932f8d0962df3e3e6202009ffc12004bf08 (diff)
media: iris: Fix firmware reference leak and unmap memory after load
When we succeed loading the firmware, we don't want to hold on to the firmware pointer anymore, since it won't be freed anywhere else. The same applies for the mapped memory. Unmapping the memory is particularly important since the memory will be protected after the Iris firmware is started, so we need to make sure there will be no accidental access to this region (even if just a speculative one from the CPU). Almost the same firmware loading code also exists in venus/firmware.c, there it is implemented correctly. Fix this by dropping the early "return ret" and move the call of qcom_scm_pas_auth_and_reset() out of iris_load_fw_to_memory(). We should unmap the memory before bringing the firmware out of reset. Cc: stable@vger.kernel.org Fixes: d19b163356b8 ("media: iris: implement video firmware load/unload") Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org> Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> Reviewed-by: Dikshita Agarwal <quic_dikshita@quicinc.com> Signed-off-by: Bryan O'Donoghue <bod@kernel.org> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Diffstat (limited to 'rust/helpers/platform.c')
0 files changed, 0 insertions, 0 deletions