1 From fdcbd7ebf09947c2b65cbb10366eba6382e3c0d6 Mon Sep 17 00:00:00 2001
2 From: Prasad J Pandit <pjp@fedoraproject.org>
3 Date: Wed, 25 May 2016 16:01:29 +0530
4 Subject: [PATCH 2/9] scsi: megasas: use appropriate property buffer size
6 When setting MegaRAID SAS controller properties via MegaRAID
7 Firmware Interface(MFI) commands, a user supplied size parameter
8 is used to set property value. Use appropriate size value to avoid
11 Reported-by: Li Qiang <liqiang6-s@360.cn>
12 Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
13 Message-Id: <1464172291-2856-2-git-send-email-ppandit@redhat.com>
14 Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
20 hw/scsi/megasas.c | 2 +-
21 1 file changed, 1 insertion(+), 1 deletion(-)
23 diff --git a/hw/scsi/megasas.c b/hw/scsi/megasas.c
24 index 8526c01..05c72b0 100644
25 --- a/hw/scsi/megasas.c
26 +++ b/hw/scsi/megasas.c
27 @@ -1445,7 +1445,7 @@ static int megasas_dcmd_set_properties(MegasasState *s, MegasasCmd *cmd)
29 return MFI_STAT_INVALID_PARAMETER;
31 - dma_buf_write((uint8_t *)&info, cmd->iov_size, &cmd->qsg);
32 + dma_buf_write((uint8_t *)&info, dcmd_size, &cmd->qsg);
33 trace_megasas_dcmd_unsupported(cmd->index, cmd->iov_size);