diff options
author | Wentao Liang <vulab@iscas.ac.cn> | 2025-04-08 15:30:01 +0800 |
---|---|---|
committer | Damien Le Moal <dlemoal@kernel.org> | 2025-04-09 15:24:49 +0900 |
commit | 8d46a27085039158eb5e253ab8a35a0e33b5e864 (patch) | |
tree | d97204940f43d25ad9b68ae789a888e8768d44cc /tools/perf/scripts/python/libxed.py | |
parent | ad320e408a8c95a282ab9c05cdf0c9b95e317985 (diff) | |
download | linux-8d46a27085039158eb5e253ab8a35a0e33b5e864.tar.gz linux-8d46a27085039158eb5e253ab8a35a0e33b5e864.tar.bz2 linux-8d46a27085039158eb5e253ab8a35a0e33b5e864.zip |
ata: sata_sx4: Add error handling in pdc20621_i2c_read()
The function pdc20621_prog_dimm0() calls the function pdc20621_i2c_read()
but does not handle the error if the read fails. This could lead to
process with invalid data. A proper implementation can be found in
/source/drivers/ata/sata_sx4.c, pdc20621_prog_dimm_global(). As mentioned
in its commit: bb44e154e25125bef31fa956785e90fccd24610b, the variable spd0
might be used uninitialized when pdc20621_i2c_read() fails.
Add error handling to pdc20621_i2c_read(). If a read operation fails,
an error message is logged via dev_err(), and return a negative error
code.
Add error handling to pdc20621_prog_dimm0() in pdc20621_dimm_init(), and
return a negative error code if pdc20621_prog_dimm0() fails.
Fixes: 4447d3515616 ("libata: convert the remaining SATA drivers to new init model")
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
Reviewed-by: Niklas Cassel <cassel@kernel.org>
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/libxed.py')
0 files changed, 0 insertions, 0 deletions