Skip to contentSkip to conversation

megaraid_sas: a fix in fw_crash_buffer_show

PATCH Applied Tomas Henzl 2 participants 2 messages Mar 24, 2023 – Mar 25, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 megaraid_sas: a fix in fw_crash_buffer_show

If crash_dump_buf is not allocated then crash dump can't be available.
Replace logical 'and' with 'or'.

---
 drivers/scsi/megaraid/megaraid_sas_base.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/megaraid/megaraid_sas_base.c +1 -1
index 63ea0aed47aa..c9e2aa2f952f 100644
@@ -3298,7 +3298,7 @@ fw_crash_buffer_show(struct device *cdev,
 
 	spin_lock_irqsave(&instance->crashdump_lock, flags);
 	buff_offset = instance->fw_crash_buffer_offset;
-	if (!instance->crash_dump_buf &&
+	if (!instance->crash_dump_buf ||
 		!((instance->fw_crash_state == AVAILABLE) ||
 		(instance->fw_crash_state == COPYING))) {
 		dev_err(&instance->pdev->dev,
Signature · 1 line
2.39.1
#1 lore raw

Tomas,

Quoted 2 lines

If crash_dump_buf is not allocated then crash dump can't be available. Replace logical 'and' with 'or'.

Applied to 6.3/scsi-fixes, thanks!

[1/1] scsi: megaraid_sas: Fix fw_crash_buffer_show()

      https://git.kernel.org/mkp/scsi/c/0808ed6ebbc2
Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering