git: 356155fe0237 - main - Fix bd82711aff98 serial number trailing spaces removal.
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 09 May 2022 14:30:19 UTC
The branch main has been updated by mav:
URL: https://cgit.FreeBSD.org/src/commit/?id=356155fe02379b8bae1dc613d4df375f542236a1
commit 356155fe02379b8bae1dc613d4df375f542236a1
Author: Alexander Motin <mav@FreeBSD.org>
AuthorDate: 2022-05-09 14:23:23 +0000
Commit: Alexander Motin <mav@FreeBSD.org>
CommitDate: 2022-05-09 14:30:04 +0000
Fix bd82711aff98 serial number trailing spaces removal.
For devices returning 16 byte serial numbers with 8 leading spaces
this falsely removed everything due to looking at wrong offset.
---
sys/cam/scsi/scsi_xpt.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sys/cam/scsi/scsi_xpt.c b/sys/cam/scsi/scsi_xpt.c
index 77c47d578ae3..8c83ce08d635 100644
--- a/sys/cam/scsi/scsi_xpt.c
+++ b/sys/cam/scsi/scsi_xpt.c
@@ -1621,7 +1621,7 @@ probe_device_check:
* trailing spaces. Remove them.
*/
while (slen > 0 &&
- serial_buf->serial_num[slen - 1] == ' ')
+ serial_buf->serial_num[start + slen - 1] == ' ')
slen--;
memcpy(path->device->serial_num,
&serial_buf->serial_num[start], slen);