Skip to content

Commit 8823abe

Browse files
shivasharan-smartinkpetersen
authored andcommitted
scsi: megaraid_sas: Fix endianness issues in DCMD handling
Signed-off-by: Kashyap Desai <[email protected]> Signed-off-by: Shivasharan S <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Reviewed-by: Tomas Henzl <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 690e9c3 commit 8823abe

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

drivers/scsi/megaraid/megaraid_sas_base.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6866,6 +6866,7 @@ megasas_mgmt_fw_ioctl(struct megasas_instance *instance,
68666866
void *sense = NULL;
68676867
dma_addr_t sense_handle;
68686868
unsigned long *sense_ptr;
6869+
u32 opcode;
68696870

68706871
memset(kbuff_arr, 0, sizeof(kbuff_arr));
68716872

@@ -6893,15 +6894,16 @@ megasas_mgmt_fw_ioctl(struct megasas_instance *instance,
68936894
cmd->frame->hdr.flags &= cpu_to_le16(~(MFI_FRAME_IEEE |
68946895
MFI_FRAME_SGL64 |
68956896
MFI_FRAME_SENSE64));
6897+
opcode = le32_to_cpu(cmd->frame->dcmd.opcode);
68966898

6897-
if (cmd->frame->dcmd.opcode == MR_DCMD_CTRL_SHUTDOWN) {
6899+
if (opcode == MR_DCMD_CTRL_SHUTDOWN) {
68986900
if (megasas_get_ctrl_info(instance) != DCMD_SUCCESS) {
68996901
megasas_return_cmd(instance, cmd);
69006902
return -1;
69016903
}
69026904
}
69036905

6904-
if (cmd->frame->dcmd.opcode == MR_DRIVER_SET_APP_CRASHDUMP_MODE) {
6906+
if (opcode == MR_DRIVER_SET_APP_CRASHDUMP_MODE) {
69056907
error = megasas_set_crash_dump_params_ioctl(cmd);
69066908
megasas_return_cmd(instance, cmd);
69076909
return error;
@@ -6975,8 +6977,7 @@ megasas_mgmt_fw_ioctl(struct megasas_instance *instance,
69756977
cmd->sync_cmd = 0;
69766978
dev_err(&instance->pdev->dev,
69776979
"return -EBUSY from %s %d opcode 0x%x cmd->cmd_status_drv 0x%x\n",
6978-
__func__, __LINE__, cmd->frame->dcmd.opcode,
6979-
cmd->cmd_status_drv);
6980+
__func__, __LINE__, opcode, cmd->cmd_status_drv);
69806981
return -EBUSY;
69816982
}
69826983

0 commit comments

Comments
 (0)