Message ID | 1431760673-7180-8-git-send-email-akinobu.mita@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
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) |
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(+)