Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 45569
b: refs/heads/master
c: 9b80cb4
h: refs/heads/master
i:
  45567: 7e365dd
v: v3
  • Loading branch information
Mike Christie authored and James Bottomley committed Jan 6, 2007
1 parent f08dc03 commit d62964d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 94cb3f822bb806a750e1e1c8457bee6e96671569
refs/heads/master: 9b80cb4be1f4181875e0cf274dc59f42964fdf1b
6 changes: 3 additions & 3 deletions trunk/drivers/scsi/libiscsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ static int iscsi_scsi_cmd_rsp(struct iscsi_conn *conn, struct iscsi_hdr *hdr,
}

if (rhdr->cmd_status == SAM_STAT_CHECK_CONDITION) {
int senselen;
uint16_t senselen;

if (datalen < 2) {
invalid_datalen:
Expand All @@ -270,12 +270,12 @@ static int iscsi_scsi_cmd_rsp(struct iscsi_conn *conn, struct iscsi_hdr *hdr,
goto out;
}

senselen = (data[0] << 8) | data[1];
senselen = be16_to_cpu(*(uint16_t *)data);
if (datalen < senselen)
goto invalid_datalen;

memcpy(sc->sense_buffer, data + 2,
min(senselen, SCSI_SENSE_BUFFERSIZE));
min_t(uint16_t, senselen, SCSI_SENSE_BUFFERSIZE));
debug_scsi("copied %d bytes of sense\n",
min(senselen, SCSI_SENSE_BUFFERSIZE));
}
Expand Down

0 comments on commit d62964d

Please sign in to comment.