summaryrefslogtreecommitdiff
path: root/extras/scsi_id/scsi_serial.c
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@vrfy.org>2008-07-10 22:22:10 +0200
committerKay Sievers <kay.sievers@vrfy.org>2008-07-10 22:22:10 +0200
commit05364975aff0bfaca1b5fb23963cee7d2201f99a (patch)
treecd2c6b12d3d716444e2a680a403d116a8105cf32 /extras/scsi_id/scsi_serial.c
parent52b375bc3bf07e4901b09707b05ee380bf6680bb (diff)
scsi_id: the fallback fix broke error handling
Diffstat (limited to 'extras/scsi_id/scsi_serial.c')
-rw-r--r--extras/scsi_id/scsi_serial.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/extras/scsi_id/scsi_serial.c b/extras/scsi_id/scsi_serial.c
index 8f160306bd..016075c3ea 100644
--- a/extras/scsi_id/scsi_serial.c
+++ b/extras/scsi_id/scsi_serial.c
@@ -351,13 +351,13 @@ resend:
io_buf = (void *)&io_hdr;
}
- if (ioctl(fd, SG_IO, io_buf) < 0) {
+ retval = ioctl(fd, SG_IO, io_buf);
+ if (retval < 0) {
if ((errno == EINVAL || errno == ENOSYS) && dev_scsi->use_sg == 4) {
dev_scsi->use_sg = 3;
goto resend;
}
info("%s: ioctl failed: %s\n", dev_scsi->kernel, strerror(errno));
- retval = -1;
goto error;
}
@@ -806,6 +806,7 @@ int scsi_std_inquiry(struct scsi_id_device *dev_scsi, const char *devname)
if (err < 0)
goto out;
+ err = 0;
memcpy(dev_scsi->vendor, buf + 8, 8);
dev_scsi->vendor[8] = '\0';
memcpy(dev_scsi->model, buf + 16, 16);