diff options
| author | Ian Rogers <irogers@google.com> | 2025-12-09 14:37:56 -0800 |
|---|---|---|
| committer | Bjorn Helgaas <bhelgaas@google.com> | 2025-12-26 11:14:23 -0600 |
| commit | 0297dce758a021ccf2c0f4e164d5403ef722961c (patch) | |
| tree | 09d35b409ed67578aa72e2b92b808bf9fa2089c1 /tools/perf/lib/Documentation/tutorial/git@git.tavy.me:linux.git | |
| parent | 8f0b4cce4481fb22653697cced8d0d04027cb1e8 (diff) | |
PCI: cadence: Avoid signed 64-bit truncation and invalid sort
The cdns_pcie_host_dma_ranges_cmp() element comparison function used by
list_sort() is of type list_cmp_func_t, so it returns a 32-bit int.
cdns_pcie_host_dma_ranges_cmp() computes a resource_size_t difference that
may be a 64-bit value, and truncating that difference to a 32-bit return
value may change the sign and result in an invalid sort order.
Avoid the truncation and invalid sort order by returning -1, 0, or 1.
Signed-off-by: Ian Rogers <irogers@google.com>
Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
[bhelgaas: commit log]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Link: https://patch.msgid.link/20251209223756.2321578-1-irogers@google.com
Diffstat (limited to 'tools/perf/lib/Documentation/tutorial/git@git.tavy.me:linux.git')
0 files changed, 0 insertions, 0 deletions
