diff --git a/sys/cam/scsi/scsi_xpt.c b/sys/cam/scsi/scsi_xpt.c --- a/sys/cam/scsi/scsi_xpt.c +++ b/sys/cam/scsi/scsi_xpt.c @@ -1615,6 +1615,14 @@ */ slen = 0; } + /* + * In apparent violation of the spec, some + * devices pad their serial numbers with + * trailing spaces. Remove them. + */ + while (slen > 0 && + serial_buf->serial_num[slen - 1] == ' ') + slen--; memcpy(path->device->serial_num, &serial_buf->serial_num[start], slen); path->device->serial_num_len = slen;