summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python
diff options
context:
space:
mode:
authorFrancesco Magazzu <postadelmaga@gmail.com>2026-09-18 15:16:19 +0200
committerLyude Paul <lyude@redhat.com>2026-09-18 14:09:01 -0400
commit7ca7b8b5f2cc89ee843c2eab3272aac5aafb7b73 (patch)
tree6cee0c4702151dff47bb46e002acf18ab76bd9dc /tools/perf/scripts/python
parent866dbd17c3d5f599b9d93ea9bd5b3d6859ff8350 (diff)
downloadlinux-next-7ca7b8b5f2cc89ee843c2eab3272aac5aafb7b73.tar.gz
linux-next-7ca7b8b5f2cc89ee843c2eab3272aac5aafb7b73.zip
drm/nouveau/device: don't use the pstate cursor after the loop
nvkm_control_mthd_pstate_attr() looks up the pstate at the index supplied by userspace by walking clk->states, and then keeps using the list_for_each_entry cursor after the loop. This is not triggerable today: the function already rejects args->v0.state >= clk->state_nr before the loop, and clk->state_nr is kept in sync with the number of entries on clk->states, so the lookup always breaks on a real entry. Should the loop ever run to completion, the cursor would point at the list head rather than at a pstate, and the pstate->base.domain[] read and the walk of pstate->list that follow would read past it. Rather than leave that trap in place, track whether the entry was found and return -EINVAL if it was not, like the other lookup failures in this function. No functional change. Signed-off-by: Francesco Magazzu <postadelmaga@gmail.com> Reviewed-by: Lyude Paul <lyude@redhat.com> Signed-off-by: Lyude Paul <lyude@redhat.com> Link: https://patch.msgid.link/20260918131620.405133-4-postadelmaga@gmail.com
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions