summaryrefslogtreecommitdiffstats
path: root/src/udev
diff options
context:
space:
mode:
authorAleksey Vasenev <margtu-fivt@ya.ru>2022-10-05 21:33:53 +0200
committerYu Watanabe <watanabe.yu+github@gmail.com>2022-10-06 06:50:30 +0200
commit2be1ae54badf7a3a12908a8094ebaba8f91887ca (patch)
treeab575d0f3dd7825ab57a32d0b411b9a56fb636a2 /src/udev
parenttest: configure ldconfig's cache in the minimal verity images (diff)
downloadsystemd-2be1ae54badf7a3a12908a8094ebaba8f91887ca.tar.xz
systemd-2be1ae54badf7a3a12908a8094ebaba8f91887ca.zip
ata_id: Fixed getting Response Code from SCSI Sense Data (#24921)
The Response Code is contained in the first byte of the SCSI Sense Data. Bit number 7 is reserved or has a different meaning for some Response Codes and is set to 1 for some drives.
Diffstat (limited to 'src/udev')
-rw-r--r--src/udev/ata_id/ata_id.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/udev/ata_id/ata_id.c b/src/udev/ata_id/ata_id.c
index f451c0d0e1..bae4d03b4f 100644
--- a/src/udev/ata_id/ata_id.c
+++ b/src/udev/ata_id/ata_id.c
@@ -162,8 +162,8 @@ static int disk_identify_command(
return ret;
}
- if (!(sense[0] == 0x72 && desc[0] == 0x9 && desc[1] == 0x0c) &&
- !(sense[0] == 0x70 && sense[12] == 0x00 && sense[13] == 0x1d)) {
+ if (!((sense[0] & 0x7f) == 0x72 && desc[0] == 0x9 && desc[1] == 0x0c) &&
+ !((sense[0] & 0x7f) == 0x70 && sense[12] == 0x00 && sense[13] == 0x1d)) {
errno = EIO;
return -1;
}
@@ -240,7 +240,7 @@ static int disk_identify_packet_device_command(
return ret;
}
- if (!(sense[0] == 0x72 && desc[0] == 0x9 && desc[1] == 0x0c)) {
+ if (!((sense[0] & 0x7f) == 0x72 && desc[0] == 0x9 && desc[1] == 0x0c)) {
errno = EIO;
return -1;
}