]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
scsi: megaraid_sas: Fix fw_crash_buffer_show()
authorTomas Henzl <thenzl@redhat.com>
Fri, 24 Mar 2023 13:52:49 +0000 (14:52 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Apr 2023 12:29:59 +0000 (14:29 +0200)
[ Upstream commit 0808ed6ebbc292222ca069d339744870f6d801da ]

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

Signed-off-by: Tomas Henzl <thenzl@redhat.com>
Link: https://lore.kernel.org/r/20230324135249.9733-1-thenzl@redhat.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/scsi/megaraid/megaraid_sas_base.c

index 3ceece9883383b78969fac6c87bcca3bbd5a61b1..c895189375e2b6afc5c2616c9934ba9b334bdb59 100644 (file)
@@ -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,