diff options
author | Shivasharan S <shivasharan.srikanteshwara@broadcom.com> | 2017-08-23 14:47:00 +0300 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2017-08-25 05:29:12 +0300 |
commit | 8823abeddbbcefd4603b02e6518311e17557156f (patch) | |
tree | 81f9167c5d6535d9ce284dec628703c065088f3e /drivers/scsi/megaraid | |
parent | 690e9c38858f870f4d83e7495feaca5417f65c6b (diff) | |
download | linux-8823abeddbbcefd4603b02e6518311e17557156f.tar.xz |
scsi: megaraid_sas: Fix endianness issues in DCMD handling
Signed-off-by: Kashyap Desai <kashyap.desai@broadcom.com>
Signed-off-by: Shivasharan S <shivasharan.srikanteshwara@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/megaraid')
-rw-r--r-- | drivers/scsi/megaraid/megaraid_sas_base.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c index 2c309ec33696..b8b46540d909 100644 --- a/drivers/scsi/megaraid/megaraid_sas_base.c +++ b/drivers/scsi/megaraid/megaraid_sas_base.c @@ -6866,6 +6866,7 @@ megasas_mgmt_fw_ioctl(struct megasas_instance *instance, void *sense = NULL; dma_addr_t sense_handle; unsigned long *sense_ptr; + u32 opcode; memset(kbuff_arr, 0, sizeof(kbuff_arr)); @@ -6893,15 +6894,16 @@ megasas_mgmt_fw_ioctl(struct megasas_instance *instance, cmd->frame->hdr.flags &= cpu_to_le16(~(MFI_FRAME_IEEE | MFI_FRAME_SGL64 | MFI_FRAME_SENSE64)); + opcode = le32_to_cpu(cmd->frame->dcmd.opcode); - if (cmd->frame->dcmd.opcode == MR_DCMD_CTRL_SHUTDOWN) { + if (opcode == MR_DCMD_CTRL_SHUTDOWN) { if (megasas_get_ctrl_info(instance) != DCMD_SUCCESS) { megasas_return_cmd(instance, cmd); return -1; } } - if (cmd->frame->dcmd.opcode == MR_DRIVER_SET_APP_CRASHDUMP_MODE) { + if (opcode == MR_DRIVER_SET_APP_CRASHDUMP_MODE) { error = megasas_set_crash_dump_params_ioctl(cmd); megasas_return_cmd(instance, cmd); return error; @@ -6975,8 +6977,7 @@ megasas_mgmt_fw_ioctl(struct megasas_instance *instance, cmd->sync_cmd = 0; dev_err(&instance->pdev->dev, "return -EBUSY from %s %d opcode 0x%x cmd->cmd_status_drv 0x%x\n", - __func__, __LINE__, cmd->frame->dcmd.opcode, - cmd->cmd_status_drv); + __func__, __LINE__, opcode, cmd->cmd_status_drv); return -EBUSY; } |