projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0307045
)
ata: libata-core: Check errors in sata_print_link_status()
author
Li Zhong
<floridsleeves@gmail.com>
Sat, 3 Sep 2022 23:10:39 +0000
(16:10 -0700)
committer
Damien Le Moal
<damien.lemoal@opensource.wdc.com>
Fri, 16 Sep 2022 14:24:06 +0000
(23:24 +0900)
sata_scr_read() could return negative error code on failure. Check the
return value when reading the control register.
Signed-off-by: Li Zhong <floridsleeves@gmail.com>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
drivers/ata/libata-core.c
patch
|
blob
|
history
diff --git
a/drivers/ata/libata-core.c
b/drivers/ata/libata-core.c
index d0242c75aac59b8ef25659bd182b01415c2c8547..75b86913db1ac90f8d058f91037310f13caf0c15 100644
(file)
--- a/
drivers/ata/libata-core.c
+++ b/
drivers/ata/libata-core.c
@@
-3021,7
+3021,8
@@
static void sata_print_link_status(struct ata_link *link)
if (sata_scr_read(link, SCR_STATUS, &sstatus))
return;
- sata_scr_read(link, SCR_CONTROL, &scontrol);
+ if (sata_scr_read(link, SCR_CONTROL, &scontrol))
+ return;
if (ata_phys_link_online(link)) {
tmp = (sstatus >> 4) & 0xf;