From patchwork Fri Feb 24 14:43:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ranjan Kumar X-Patchwork-Id: 13151313 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 801C1C61DA3 for ; Fri, 24 Feb 2023 14:44:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230057AbjBXOom (ORCPT ); Fri, 24 Feb 2023 09:44:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33394 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230020AbjBXOob (ORCPT ); Fri, 24 Feb 2023 09:44:31 -0500 Received: from mail-pl1-x634.google.com (mail-pl1-x634.google.com [IPv6:2607:f8b0:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1AF6C1A66D for ; Fri, 24 Feb 2023 06:44:24 -0800 (PST) Received: by mail-pl1-x634.google.com with SMTP id ky4so18139954plb.3 for ; Fri, 24 Feb 2023 06:44:23 -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=Jb+xMar/YXxDBrVOhfUp/ZWx3NX5Xo7jzlvkLsKM7+k=; b=WIYbL8K7e8xrxc1ncBtNz22qVLWpoNlx3KwEx1zkVV4ChQ199nqPniC4RvHtr1Y93N PSN1XxNV3Q8cJGf0+xwSiAPB7IeQ21O+R+P1tnxWIIHZWgQVphOu+T5aaxtP8JWyf2jU nvEKt+hES2IRbNnW8qNl9zCQ5u6XhGR+anFEc= 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=Jb+xMar/YXxDBrVOhfUp/ZWx3NX5Xo7jzlvkLsKM7+k=; b=2b0p/+1nrLkvENh/mpe7TT7/6Pb90nCNI5g+89qUwavzo1oyFLxGt6Viq/+dWXgYwZ Go2QqLnE7Wwoo6uMHDoJToVIZH68MJuEUtX3bG0BgEnqlJuCsQjhaTIW2LXZ2ej2T9/N +BR7wXhFg8mTLzYPb+bdNRfYpNH7yCM2sdiB23pkiBesv0Cm+h6G4sZjGmEJkP0bSCUN 2At0W8PlF4qFJq7i/7YVN1wX/xSOzwK6qZRU5VHhQtF4ygrQNg1+/ZkoD5+flpszGcOB 3WbpRtyluu+kMTdPKBEPw8+pfH67t1iusanAP7cSGDrzVcvkR83DwcsRsMbCh7KfZmE+ O3lQ== X-Gm-Message-State: AO0yUKVTSmIvQDXge7pZP8aPyikDp82Ih6NLsEaPBeQ7EamksOjNKqa5 MuRg/hTFNxU1bRL0wqTe+nnox9S5Pao0P1z6gypupnfdqoIiz4a2NQjut6IntHjpuyTiAUlgkJa LA7eISj2n3oCRvZY/8PnGxonefOCU8XIy8y3oNY3CIQyNnBby1Z0wx/Fg7Wqvu6fdLY347wrBHv ivjbHmEZA= X-Google-Smtp-Source: AK7set9yyqogtq6Oz4m/6wZZFAZy/e/IQcbBPQtw+3VYAweGMwIxQSfIExoJdUzTDXz5m0K0Ehh41A== X-Received: by 2002:a17:903:1104:b0:19c:ba57:a867 with SMTP id n4-20020a170903110400b0019cba57a867mr8101125plh.54.1677249863213; Fri, 24 Feb 2023 06:44:23 -0800 (PST) Received: from localhost.localdomain ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id b5-20020a170902a9c500b00186748fe6ccsm8911549plr.214.2023.02.24.06.44.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Feb 2023 06:44:22 -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 08/15] mpi3mr: Driver unload crash host when enhanced logging is enabled Date: Fri, 24 Feb 2023 06:43:13 -0800 Message-Id: <20230224144320.10601-9-ranjan.kumar@broadcom.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230224144320.10601-1-ranjan.kumar@broadcom.com> References: <20230224144320.10601-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 6f84760ca85d..d99f2094297a 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)