diff options
author | Mike Christie <michaelc@cs.wisc.edu> | 2012-05-23 21:40:54 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2012-05-30 05:34:22 -0400 |
commit | b83d543fd934d565fb243ef348b06a61d794b31d (patch) | |
tree | 58d4b585bb6b8e201b3f71c578bfbb180daca37f /drivers/scsi/be2iscsi | |
parent | 356293bc7ee39e1bb78bd159187664ffa8d45d1a (diff) |
[SCSI] be2iscsi: fix dma free size mismatch regression
This patch should go into 3.5 fixes. The bug was added in the
patches for the 3.5 feature window.
As you can see from the patch I made a mistake. During
development I switched from passing a struct to the size of
the struct, but left the sizeof. This results in us allocating
4 bytes (sizeof(int)) but then calling pci_free_consistent
with the size of the struct.
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/be2iscsi')
-rw-r--r-- | drivers/scsi/be2iscsi/be_mgmt.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/scsi/be2iscsi/be_mgmt.c b/drivers/scsi/be2iscsi/be_mgmt.c index 01bb04cd9e75..2a096795b9aa 100644 --- a/drivers/scsi/be2iscsi/be_mgmt.c +++ b/drivers/scsi/be2iscsi/be_mgmt.c | |||
@@ -571,13 +571,12 @@ free_cmd: | |||
571 | static int mgmt_alloc_cmd_data(struct beiscsi_hba *phba, struct be_dma_mem *cmd, | 571 | static int mgmt_alloc_cmd_data(struct beiscsi_hba *phba, struct be_dma_mem *cmd, |
572 | int iscsi_cmd, int size) | 572 | int iscsi_cmd, int size) |
573 | { | 573 | { |
574 | cmd->va = pci_alloc_consistent(phba->ctrl.pdev, sizeof(size), | 574 | cmd->va = pci_alloc_consistent(phba->ctrl.pdev, size, &cmd->dma); |
575 | &cmd->dma); | ||
576 | if (!cmd->va) { | 575 | if (!cmd->va) { |
577 | SE_DEBUG(DBG_LVL_1, "Failed to allocate memory for if info\n"); | 576 | SE_DEBUG(DBG_LVL_1, "Failed to allocate memory for if info\n"); |
578 | return -ENOMEM; | 577 | return -ENOMEM; |
579 | } | 578 | } |
580 | memset(cmd->va, 0, sizeof(size)); | 579 | memset(cmd->va, 0, size); |
581 | cmd->size = size; | 580 | cmd->size = size; |
582 | be_cmd_hdr_prepare(cmd->va, CMD_SUBSYSTEM_ISCSI, iscsi_cmd, size); | 581 | be_cmd_hdr_prepare(cmd->va, CMD_SUBSYSTEM_ISCSI, iscsi_cmd, size); |
583 | return 0; | 582 | return 0; |