Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp4048649pxy; Tue, 4 May 2021 16:45:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxNbqXScspMmLrsvc2a1+Eq+M8uFeFC/SSeVSBRzbn6LfVbqWHxsgJcnH/+WeXnhhhrVEYv X-Received: by 2002:a17:907:62a7:: with SMTP id nd39mr5494140ejc.502.1620171905090; Tue, 04 May 2021 16:45:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620171905; cv=none; d=google.com; s=arc-20160816; b=CQVVt+qp9gaN19iR4QI8czbhZ1WSzuxIYPgjlFFgg9Z5JYNEmcH3crNLvMn/adsATN I9EenUVMpkGyUdMAQItedme1CPD2J2YWy6lML19kFlHazqcT/nqbeVABhV6vDsahfBzT IU8oLrMUZDCSoStPJoxXR5qseMu8ajyhqHy/k9VazITphtM6OWjArLjEmBjFsVFT7mBO kkpkTDK6wEbHDKs8SJpIdrpRDxyxshD1EaaYejmV+FNPFTxLQyr3FtL140JfIOTOg2Ku 01BsORshr+7X8X1BveX0DIcvJAPmbdk780N0Au8ZsTMNMYQhfJXdkRqsDBvd/jwMBhsu 8Izw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dmarc-filter:sender:dkim-signature; bh=AIgbbr+JH32/l8eSPcxi2yZ//+qpxf14riHFPLDdtgw=; b=q8P1ahajAw3LSM2OBsXyYny8AlTG48D7lB/dy1pd/JAoawP6M28dmEKdQoYFYXyeTj XRzHF9Z4ZVYwkz9dDyGivDgs56p1lzsHrAxkc17zN8q/JKii8QYjiZ3C9eWtGjqE4NTt dvrclY3gbRnuunwdRwYI+qU2VSQchhwvMblSNgDeLhBM6QB0cwpdBn7Hrk/xj05Jsu2j 8xjpo1uWNQDxlVTgZ+6teKRSFzJ3PkK8QbJNLaX0g43YajQ50pReN/Ot788pULCJVIVS LkiGyoTQPJimaCoI+wGjRKDY9eK10y7Vg2rbYUEFG43K3op4Tcv3eaiO/z3LOsYHTF7Q XAuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=wNwk5TgX; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y3si4016689ejp.444.2021.05.04.16.44.41; Tue, 04 May 2021 16:45:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=wNwk5TgX; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231664AbhEDXjf (ORCPT + 99 others); Tue, 4 May 2021 19:39:35 -0400 Received: from m43-7.mailgun.net ([69.72.43.7]:62240 "EHLO m43-7.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231697AbhEDXj1 (ORCPT ); Tue, 4 May 2021 19:39:27 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1620171511; h=References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=AIgbbr+JH32/l8eSPcxi2yZ//+qpxf14riHFPLDdtgw=; b=wNwk5TgXEwcuXrw84agInp715BSFSE+cvv85yKPnpurdjr1y0tuix1P2TDEgn//qf/7rtM/l /0Tf/fwYV9dcx1i+DXcmQbgPlrS5n6xQEtlu1+ybhsz9nJdvBgghX8ULal46sn5itZBYtb3w F1yUOc9mSvJctUECQrMBntTPTZw= X-Mailgun-Sending-Ip: 69.72.43.7 X-Mailgun-Sid: WyI3YTAwOSIsICJsaW51eC13aXJlbGVzc0B2Z2VyLmtlcm5lbC5vcmciLCAiYmU5ZTRhIl0= Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n03.prod.us-east-1.postgun.com with SMTP id 6091dae02cbba88980c9ab25 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Tue, 04 May 2021 23:38:08 GMT Sender: bbhatt=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id CFB5CC43143; Tue, 4 May 2021 23:38:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=ALL_TRUSTED,BAYES_00,SPF_FAIL autolearn=no autolearn_force=no version=3.4.0 Received: from malabar-linux.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: bbhatt) by smtp.codeaurora.org (Postfix) with ESMTPSA id AB8B2C433F1; Tue, 4 May 2021 23:38:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org AB8B2C433F1 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=fail smtp.mailfrom=bbhatt@codeaurora.org From: Bhaumik Bhatt To: manivannan.sadhasivam@linaro.org Cc: linux-arm-msm@vger.kernel.org, hemantk@codeaurora.org, jhugo@codeaurora.org, linux-kernel@vger.kernel.org, loic.poulain@linaro.org, linux-wireless@vger.kernel.org, kvalo@codeaurora.org, ath11k@lists.infradead.org, Bhaumik Bhatt Subject: [PATCH v2 2/6] bus: mhi: core: Set BHI and BHIe pointers to NULL in clean-up Date: Tue, 4 May 2021 16:37:54 -0700 Message-Id: <1620171478-35679-3-git-send-email-bbhatt@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1620171478-35679-1-git-send-email-bbhatt@codeaurora.org> References: <1620171478-35679-1-git-send-email-bbhatt@codeaurora.org> Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Set the BHI and BHIe pointers to NULL as part of clean-up. This makes sure that stale pointers are not accessed after powering MHI down. Suggested-by: Hemant Kumar Signed-off-by: Bhaumik Bhatt Reviewed-by: Jeffrey Hugo --- drivers/bus/mhi/core/init.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/bus/mhi/core/init.c b/drivers/bus/mhi/core/init.c index 11c7a3d..1cc2f22 100644 --- a/drivers/bus/mhi/core/init.c +++ b/drivers/bus/mhi/core/init.c @@ -1132,6 +1132,9 @@ void mhi_unprepare_after_power_down(struct mhi_controller *mhi_cntrl) mhi_cntrl->rddm_image = NULL; } + mhi_cntrl->bhi = NULL; + mhi_cntrl->bhie = NULL; + mhi_deinit_dev_ctxt(mhi_cntrl); } EXPORT_SYMBOL_GPL(mhi_unprepare_after_power_down); -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project