From patchwork Fri Mar 24 13:52:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomas Henzl X-Patchwork-Id: 13186775 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A4F1FC6FD20 for ; Fri, 24 Mar 2023 13:54:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231236AbjCXNyr (ORCPT ); Fri, 24 Mar 2023 09:54:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46382 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229600AbjCXNyq (ORCPT ); Fri, 24 Mar 2023 09:54:46 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A71FA12F25 for ; Fri, 24 Mar 2023 06:54:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1679666040; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=OwM9DPtgtf2jgXmDgnB65+M3AxIHDiwgzbdklyGvYs0=; b=b7AQvNviCizl2i148X796+NjnvimB/4HwXBmWPKzVtspn+dvTrwF2BaNnSgIVyyKr/pjtW WUPPN9ynJEsFADOuZSpP9dpUUKG5zG9myEKZhX1YotclBxn5rOWxvBL7xo8ZHtBDg/Mmcq g+vAGxJgejkGpODLI1YP9CQs1UW9Ghs= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-2-6hvVURq7PgaQYpqLV38_Qw-1; Fri, 24 Mar 2023 09:52:51 -0400 X-MC-Unique: 6hvVURq7PgaQYpqLV38_Qw-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0D2643C0F244; Fri, 24 Mar 2023 13:52:51 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.45.226.232]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6F4F11121314; Fri, 24 Mar 2023 13:52:50 +0000 (UTC) From: Tomas Henzl To: linux-scsi@vger.kernel.org Cc: sumit.saxena@broadcom.com, chandrakanth.patil@broadcom.com Subject: [PATCH] megaraid_sas: a fix in fw_crash_buffer_show Date: Fri, 24 Mar 2023 14:52:49 +0100 Message-Id: <20230324135249.9733-1-thenzl@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org If crash_dump_buf is not allocated then crash dump can't be available. Replace logical 'and' with 'or'. Signed-off-by: Tomas Henzl --- drivers/scsi/megaraid/megaraid_sas_base.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c index 63ea0aed47aa..c9e2aa2f952f 100644 --- a/drivers/scsi/megaraid/megaraid_sas_base.c +++ b/drivers/scsi/megaraid/megaraid_sas_base.c @@ -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,