diff options
| author | Li RongQing <lirongqing@baidu.com> | 2026-06-01 08:12:40 -0400 |
|---|---|---|
| committer | Will Deacon <will@kernel.org> | 2026-07-22 12:32:50 +0000 |
| commit | 843e149989665f8309ad2efe6048dc76591e1f94 (patch) | |
| tree | 14de58103a76c1cf5bbd4fe763ef8811e8731a20 /tools/perf/scripts/python/flamegraph.py | |
| parent | 16f52863b2ec04352e29c978022bc08a3635f0b2 (diff) | |
iommu/amd: Fix undefined behavior in devid_write debugfs function
When for_each_pci_segment() loop completes without finding a matching
segment, the pci_seg pointer is not NULL but points to an invalid memory
location (the list head). Accessing pci_seg->id after the loop causes
undefined behavior.
Fix this by handling the successful case inside the loop and returning
-EINVAL after the loop if no matching segment is found.
Fixes: 2e98940f123d9 ("iommu/amd: Add support for device id user input")
Signed-off-by: Li RongQing <lirongqing@baidu.com>
Reviewed-by: Ankit Soni <Ankit.Soni@amd.com>
Signed-off-by: Will Deacon <will@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/flamegraph.py')
0 files changed, 0 insertions, 0 deletions
