Commit 68519ac
committed
ata: sata_sx4: Add error handling in pdc20621_i2c_read()
JIRA: https://issues.redhat.com/browse/RHEL-72617
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: bb44e15, 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: 4447d35 ("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>
(cherry picked from commit 8d46a27)
Signed-off-by: Tomas Henzl <thenzl@redhat.com>1 parent 3a8f243 commit 68519ac
1 file changed
+10
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1117 | 1117 | | |
1118 | 1118 | | |
1119 | 1119 | | |
1120 | | - | |
1121 | | - | |
1122 | | - | |
| 1120 | + | |
| 1121 | + | |
| 1122 | + | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
1123 | 1128 | | |
1124 | 1129 | | |
1125 | 1130 | | |
| |||
1284 | 1289 | | |
1285 | 1290 | | |
1286 | 1291 | | |
| 1292 | + | |
| 1293 | + | |
1287 | 1294 | | |
1288 | 1295 | | |
1289 | 1296 | | |
| |||
0 commit comments