mirror of
https://github.com/torvalds/linux.git
synced 2026-07-28 10:09:10 +02:00
scsi: pm8001: Reject non-fatal dump when controller is crashed
pm80xx_get_non_fatal_dump() can be called even after the controller has entered a fatal error state. In that case the forensic memory contents are not safe to access for a non-fatal dump request, and attempting to do so can trigger a call trace. Check controller_fatal_error before reading the non-fatal dump buffer and return -EINVAL when the controller is already in a crashed state. This prevents non-fatal dump collection from running in an invalid controller state. Signed-off-by: Kumar Meiyappan <kumar.meiyappan@microchip.com> Signed-off-by: Sagar Biradar <sagar.biradar@microchip.com> Link: https://patch.msgid.link/20260416154650.415624-1-sagar.biradar@microchip.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
parent
2a8fbcfb04
commit
aa3b8f56ef
|
|
@ -401,6 +401,13 @@ ssize_t pm80xx_get_non_fatal_dump(struct device *cdev,
|
|||
char *buf_copy = buf;
|
||||
|
||||
temp = (u32 *)pm8001_ha->memoryMap.region[FORENSIC_MEM].virt_ptr;
|
||||
|
||||
if (pm8001_ha->controller_fatal_error) {
|
||||
pm8001_dbg(pm8001_ha, FAIL,
|
||||
"non-fatal dump not available in fatal error state\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (++pm8001_ha->non_fatal_count == 1) {
|
||||
if (pm8001_ha->chip_id == chip_8001) {
|
||||
snprintf(pm8001_ha->forensic_info.data_buf.direct_data,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user