diff mbox

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

Message ID 1431760673-7180-8-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: Kashyap Desai <kashyap.desai@avagotech.com>
Cc: Sumit Saxena <sumit.saxena@avagotech.com>
Cc: Uday Lingala <uday.lingala@avagotech.com>
Cc: megaraidlinux.pdl@avagotech.com
Cc: linux-scsi@vger.kernel.org
---
 drivers/scsi/megaraid.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox

Patch

diff --git a/drivers/scsi/megaraid.c b/drivers/scsi/megaraid.c
index bc7b34c..509aead 100644
--- a/drivers/scsi/megaraid.c
+++ b/drivers/scsi/megaraid.c
@@ -759,6 +759,8 @@  mega_build_cmd(adapter_t *adapter, Scsi_Cmnd *cmd, int *busy)
 			 */
 			if( cmd->cmd_len == 6 ) {
 				mbox->m_out.numsectors = (u32) cmd->cmnd[4];
+				if (mbox->m_out.numsectors == 0)
+					mbox->m_out.numsectors = 256;
 				mbox->m_out.lba =
 					((u32)cmd->cmnd[1] << 16) |
 					((u32)cmd->cmnd[2] << 8) |