aboutsummaryrefslogtreecommitdiff
path: root/drivers/scsi/libiscsi.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-01-22 10:35:34 -0800
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-01-22 10:35:34 -0800
commit365bbe0d0caaf2ba74d56556827babf0bc66965d (patch)
tree1b5bce452bc768398b19967a3123bd8c4adcb9f1 /drivers/scsi/libiscsi.c
parent0bf98542a07ee1341830dcc4be63df85645f76b9 (diff)
parent3ef49a3b45c33b055002402f01e5da98cb773086 (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6: (30 commits) [SCSI] qla1280: set residual correctly [SCSI] fusion: bump version [SCSI] fusion: MODULE_VERSION support [SCSI] fusion: power pc and miscellaneous bug fixs [SCSI] fusion: fibre channel: return DID_ERROR for MPI_IOCSTATUS_SCSI_IOC_TERMINATED [SCSI] megaraid_sas: Update module author [SCSI] 3ware 8000 serialize reset code [SCSI] sr: fix error code check in sr_block_ioctl() [SCSI] scsi: lpfc error path fix [SCSI] aacraid: Product List Update [SCSI] libiscsi: fix senselen calculation [SCSI] iscsi: simplify IPv6 and IPv4 address printing [SCSI] iscsi: newline in printk [SCSI] iscsi: fix crypto_alloc_hash() error check [SCSI] iscsi: fix 2.6.19 data digest calculation bug [SCSI] scsi_scan: fix report lun problems with CDROM or RBC devices [SCSI] qla2xxx: Update version number to 8.01.07-k4. [SCSI] qla2xxx: Use generic isp_ops.fw_dump() function. [SCSI] qla2xxx: Perform a fw-dump when an ISP23xx RISC-paused state is detected. [SCSI] qla2xxx: Correct reset handling logic. ...
Diffstat (limited to 'drivers/scsi/libiscsi.c')
-rw-r--r--drivers/scsi/libiscsi.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c
index e11b23c641e..d37048c96ea 100644
--- a/drivers/scsi/libiscsi.c
+++ b/drivers/scsi/libiscsi.c
@@ -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:
@@ -270,12 +270,12 @@ invalid_datalen:
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));
}