diff mbox

[1/7] hpsa: fix transfer length 0 for 6-byte r/w commands

Message ID 1431760673-7180-2-git-send-email-akinobu.mita@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Akinobu Mita May 16, 2015, 7:17 a.m. UTC
For 6-byte r/w commands, transfer length 0 means 256 blocks of data,
not 0 block.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Don Brace <don.brace@pmcs.com>
Cc: iss_storagedev@hp.com
Cc: storagedev@pmcs.com
Cc: linux-scsi@vger.kernel.org
---
 drivers/scsi/hpsa.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox

Patch

diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index 8895bc9..f1d667c 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -3326,6 +3326,8 @@  static int fixup_ioaccel_cdb(u8 *cdb, int *cdb_len)
 		if (*cdb_len == 6) {
 			block = (((u32) cdb[2]) << 8) | cdb[3];
 			block_cnt = cdb[4];
+			if (block_cnt == 0)
+				block_cnt = 256;
 		} else {
 			BUG_ON(*cdb_len != 12);
 			block = (((u32) cdb[2]) << 24) |