diff options
author | Andy Shevchenko <[email protected]> | 2023-10-30 13:42:18 +0200 |
---|---|---|
committer | Bjorn Helgaas <[email protected]> | 2023-11-20 16:38:00 -0600 |
commit | 3171e46d677a668eed3086da78671f1e4f5b8405 (patch) | |
tree | a5ef04388763aedc295f40b5d8f434a8fe592144 /scripts/generate_rust_analyzer.py | |
parent | b85ea95d086471afb4ad062012a4d73cd328fa86 (diff) |
PCI: Avoid potential out-of-bounds read in pci_dev_for_each_resource()
Coverity complains that pointer in the pci_dev_for_each_resource() may be
wrong, i.e., might be used for the out-of-bounds read.
There is no actual issue right now because we have another check afterwards
and the out-of-bounds read is not being performed. In any case it's better
code with this fixed, hence the proposed change.
As Jonas pointed out "It probably makes the code slightly less performant
as res will now be checked for being not NULL (which will always be true),
but I doubt it will be significant (or in any hot paths)."
Fixes: 09cc90063240 ("PCI: Introduce pci_dev_for_each_resource()")
Reported-by: Bjorn Helgaas <[email protected]>
Closes: https://lore.kernel.org/r/20230509182122.GA1259567@bhelgaas
Suggested-by: Jonas Gorski <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Andy Shevchenko <[email protected]>
Signed-off-by: Bjorn Helgaas <[email protected]>
Diffstat (limited to 'scripts/generate_rust_analyzer.py')
0 files changed, 0 insertions, 0 deletions