scsi: pm8001: reject firmware update in fatal error state
Subsystems (3)
PATCH 1/1 scsi: pm8001: reject firmware update in fatal error state
From: Kumar Meiyappan <[email protected]>
pm8001_store_update_fw() allows a firmware update request even when the controller has already entered a fatal error state.
Firmware update is not valid once the controller is in that state, and attempting it can lead to a call trace. Reject the request early by checking controller_fatal_error, set the firmware status to FAIL_PARAMETERS, and return -EINVAL.
--- drivers/scsi/pm8001/pm8001_ctl.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/scsi/pm8001/pm8001_ctl.c +8 -0
@@ -826,6 +826,14 @@ static ssize_t pm8001_store_update_fw(struct device *cdev, goto out; } +if (pm8001_ha->controller_fatal_error) { +pm8001_dbg (pm8001_ha,FAIL , +"controller in fatal error state, firmware update rejected\n" ); + pm8001_ha->fw_status =FAIL_PARAMETERS ; + ret = -EINVAL ; + goto out; + } +for (i =0 ; flash_command_table[i].code !=FLASH_CMD_NONE ; i++) {if (!memcmp (flash_command_table[i].command, cmd_ptr,strlen (cmd_ptr))) {
Signature · 1 line
2.43.0
Martin K. Petersen
AppliedSagar,
Quoted 7 lines
pm8001_store_update_fw()allows a firmware update request even when the controller has already entered a fatal error state.Firmware update is not valid once the controller is in that state, and attempting it can lead to a call trace. Reject the request early by checking
controller_fatal_error, set the firmware status toFAIL_PARAMETERS, and return-EINVAL.
Applied to 7.2/scsi-staging, thanks!
Signature · 1 line
Martin K. Petersen
Martin K. Petersen
AppliedQuoted 9 lines · Sagar Biradar
pm8001_store_update_fw()allows a firmware update request even when the controller has already entered a fatal error state.Firmware update is not valid once the controller is in that state, and attempting it can lead to a call trace. Reject the request early by checking
controller_fatal_error, set the firmware status toFAIL_PARAMETERS, and return-EINVAL.[...]
Applied to 7.2/scsi-queue, thanks!
[1/1] scsi: pm8001: reject firmware update in fatal error state
https://git.kernel.org/mkp/scsi/c/2a8fbcfb04aa
Signature · 1 line
Martin K. Petersen