From patchwork Tue Feb 28 14:08:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ranjan Kumar X-Patchwork-Id: 13154946 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 CE886C64EC7 for ; Tue, 28 Feb 2023 14:09:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229821AbjB1OJG (ORCPT ); Tue, 28 Feb 2023 09:09:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39424 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229812AbjB1OJC (ORCPT ); Tue, 28 Feb 2023 09:09:02 -0500 Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C6862A5D8 for ; Tue, 28 Feb 2023 06:08:59 -0800 (PST) Received: by mail-pl1-x62d.google.com with SMTP id p6so9709976plf.0 for ; Tue, 28 Feb 2023 06:08:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=Ytn0DtbefU3swaCSf2rHim4DT8rE+pH1jf2M+JdD3KI=; b=P6LMcG07eguW74mPnaLjRkFBCGHQoFEd7DoP4zDtXDwdQoiLc5XCH6zdb/mv9tYrpU W+D3tyhL/dz5GyZnFtUkvIZuHKu7ks7+5beEES5TOKnK0cv5R4eETxC6fmM8/Q0EvmEM 95te9Xl65FEdsWdGuTUMcwNznvKj4q+dWc2EY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Ytn0DtbefU3swaCSf2rHim4DT8rE+pH1jf2M+JdD3KI=; b=b+wUux3NQ0kj14qsLe4Bul8ZXsBOLglZfYxWIWcHGEXWBovQrFoNGehsmKvpraJrnL gq39yTWNyY3dFTce9Rv0aOZS5nPPHflT7APKpu4HMFd3jhncA1EcBPe06DE/ojrTM2M0 ObsZiwOwuuSFM+5D1XN04TNOEJEq7nBwpOnTWlCUIVrqILB/vz4yrKnDdzk7DIdmsdYN KbttHkeOg4wn8/oOw5QFUpWHTUkrnXTuvIeSw3gqw5qpSXOVaAh3BGD0+awjWqNvRNOh 5EnkKjSS7xV+eGygdGrPomOn568B4M1laCc1NnapMVKuBZVmEoqCT2xsvxkkrjPGpXuQ ZGAQ== X-Gm-Message-State: AO0yUKX+Zoh/C286grQ3Z0PYHOaF1n9+8VX+1RNKgdFwzY7n7CbbTpVU oqwNWuxU1onH1filraBs0fSVPe+REBNuwkK0SXv6lGnBdbeYID4OBNx7TU7I84pD2UQwyjK3d2G z7IgQrB2jTpsg2Q9dDNaZUlqbQjPq32H3IWE6QlHIjAMW9PeBuk7gTR7eDQ6vNPVMs0zi5quHK9 MWi4HZdrE= X-Google-Smtp-Source: AK7set+P20j/cs7R4q6fJxRo3I/qDMqwmvnAFeSgBx0iH4HWjxd0vxMgkNiVK4O7aR3bqK0WPT9Dzw== X-Received: by 2002:a17:902:ec91:b0:19a:a80e:a6d5 with SMTP id x17-20020a170902ec9100b0019aa80ea6d5mr3269267plg.23.1677593338711; Tue, 28 Feb 2023 06:08:58 -0800 (PST) Received: from localhost.localdomain ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id ji1-20020a170903324100b00198e03c3ad4sm6625465plb.278.2023.02.28.06.08.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Feb 2023 06:08:58 -0800 (PST) From: Ranjan Kumar To: linux-scsi@vger.kernel.org, martin.petersen@oracle.com Cc: rajsekhar.chundru@broadcom.com, sathya.prakash@broadcom.com, sumit.saxena@broadcom.com, Ranjan Kumar , Sreekanth Reddy Subject: [PATCH 2/6] mpi3mr: Driver unload crash host when enhanced logging is enabled Date: Tue, 28 Feb 2023 06:08:31 -0800 Message-Id: <20230228140835.4075-3-ranjan.kumar@broadcom.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230228140835.4075-1-ranjan.kumar@broadcom.com> References: <20230228140835.4075-1-ranjan.kumar@broadcom.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Driver was trying to access null pointer in a debug print while removing a device during driver unload Signed-off-by: Ranjan Kumar Signed-off-by: Sreekanth Reddy --- drivers/scsi/mpi3mr/mpi3mr_transport.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/mpi3mr/mpi3mr_transport.c b/drivers/scsi/mpi3mr/mpi3mr_transport.c index 3fc897336b5e..584daf8a3ac9 100644 --- a/drivers/scsi/mpi3mr/mpi3mr_transport.c +++ b/drivers/scsi/mpi3mr/mpi3mr_transport.c @@ -1552,7 +1552,8 @@ static void mpi3mr_sas_port_remove(struct mpi3mr_ioc *mrioc, u64 sas_address, list_for_each_entry_safe(mr_sas_phy, next_phy, &mr_sas_port->phy_list, port_siblings) { - if ((mrioc->logging_level & MPI3_DEBUG_TRANSPORT_INFO)) + if ((!mrioc->stop_drv_processing) && + (mrioc->logging_level & MPI3_DEBUG_TRANSPORT_INFO)) dev_info(&mr_sas_port->port->dev, "remove: sas_address(0x%016llx), phy(%d)\n", (unsigned long long)