From patchwork Tue Apr 5 07:33:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 556575 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 20B7FC433FE for ; Tue, 5 Apr 2022 12:26:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235621AbiDEMUc (ORCPT ); Tue, 5 Apr 2022 08:20:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33774 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343805AbiDEKjl (ORCPT ); Tue, 5 Apr 2022 06:39:41 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E57EC13CD3; Tue, 5 Apr 2022 03:24:44 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 790976141D; Tue, 5 Apr 2022 10:24:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8A697C385A0; Tue, 5 Apr 2022 10:24:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649154283; bh=XPuLNZR60B9iBBkDGoHuCp203zPgXEvWgZXhPuEdS8I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1P8n9373vTpFbADclf1jbA2oIJ415dU2InTWLxUPDz0Mk8tsGFEjL4rqt4iW3r3d2 H2yaaSfINyHTnU3NMzcW1lS6oqv9RZuk6BdgEh6CzG6ChNKM8cykt143HfSGsZDGTw bBZsRWjYfvUtZvIQDo+8K6MhqfBIdlhCwM0T1WoQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Joe Carnuccio , Nilesh Javali , "Martin K. Petersen" Subject: [PATCH 5.10 523/599] scsi: qla2xxx: Check for firmware dump already collected Date: Tue, 5 Apr 2022 09:33:37 +0200 Message-Id: <20220405070314.403287445@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070258.802373272@linuxfoundation.org> References: <20220405070258.802373272@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Joe Carnuccio commit cfbafad7c6032d449a5a07f2d273acd2437bbc6a upstream. While allocating firmware dump, check if dump is already collected and do not re-allocate the buffer. Link: https://lore.kernel.org/r/20220110050218.3958-17-njavali@marvell.com Cc: stable@vger.kernel.org Signed-off-by: Joe Carnuccio Signed-off-by: Nilesh Javali Signed-off-by: Martin K. Petersen Signed-off-by: Greg Kroah-Hartman --- drivers/scsi/qla2xxx/qla_init.c | 8 ++++++++ 1 file changed, 8 insertions(+) --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -3312,6 +3312,14 @@ qla2x00_alloc_fw_dump(scsi_qla_host_t *v struct rsp_que *rsp = ha->rsp_q_map[0]; struct qla2xxx_fw_dump *fw_dump; + if (ha->fw_dump) { + ql_dbg(ql_dbg_init, vha, 0x00bd, + "Firmware dump already allocated.\n"); + return; + } + + ha->fw_dumped = 0; + ha->fw_dump_cap_flags = 0; dump_size = fixed_size = mem_size = eft_size = fce_size = mq_size = 0; req_q_size = rsp_q_size = 0;