Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp1674928pxy; Thu, 6 May 2021 13:00:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzf3eYm+sGVzVZwVeYgmHnXNIhH5YvKuKO/5Eb9ubwcWUIO3usxjn7STtsZ7cRBcnIM+V6K X-Received: by 2002:a62:ac05:0:b029:28f:b159:cb3f with SMTP id v5-20020a62ac050000b029028fb159cb3fmr6306381pfe.39.1620331203732; Thu, 06 May 2021 13:00:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620331203; cv=none; d=google.com; s=arc-20160816; b=CtPUWZRA3wTJOuTLv3s2olb6NQ+3Dafr74moW7e9r6lzYnRply691PtaU21TCKsSlb +wC8n5boEdgUsLPZG36yo1hhrLJg0f1EYNS/F0C5hF21aViyYvKWn0ajJ6oOJ5JMfOyS 296yIwuPZl1x7LHTfPyt1CCzoQxdPtzxNlIQL4DeQpUvY52xDOoWM8Gey5yS0faYKsZI G7P15RBOS5KZQMSjvuTBa3X4gFRUi6p7gQWFb5XKIAF681buDsABHL2ypMzQdDP8uCs8 Uzun4RRZPoMMrb1k/qzihnThQ3kSKGK5GXl9fMzEAbohs4+HLiLZxUNaAQcpM6Qw32O5 qOKg== 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=qqLzVjtXrQshZwmYUXuuv/rvwTmeHj2Lr0oRq+Jm5Ls=; b=vJGwGJRU1/CodNv/B3ghnuMpn7LWwJXXZxGePaKIaDZDLx+4GN/0pUnVzFO1MiFugT tNa9k9fB4Ysl5hni7Hy3C9DFu9dTGb0s+zZOJqdtdjyMhYsCeYNPvDk9k86Z+DEcb5aF AqjFdxEsHxLJq8S5OnviQ+xaAzNDbdbhJBVOY6BN5LMLeUqn/B61o2dITip/N7fh147V R8nxeL6caDT3y4SU/UjF/dLgXDLkH3Fh/hRvJ8PPIcjlac2IFoly61LCeItw9rLXITZn U3kXeRgI3GyfuFL3dvjxYtRw3qFuLQHYMV4u4YAsG4lC0lCcrIJVyYwxvjkXzCfijNIQ 8uaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=WxLEefiR; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=qti.qualcomm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k5si12800249pja.159.2021.05.06.12.59.50; Thu, 06 May 2021 13:00:03 -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=WxLEefiR; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=qti.qualcomm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235147AbhEFTeL (ORCPT + 99 others); Thu, 6 May 2021 15:34:11 -0400 Received: from so254-9.mailgun.net ([198.61.254.9]:21907 "EHLO so254-9.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235161AbhEFTeJ (ORCPT ); Thu, 6 May 2021 15:34:09 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1620329591; h=References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=qqLzVjtXrQshZwmYUXuuv/rvwTmeHj2Lr0oRq+Jm5Ls=; b=WxLEefiRepEIE76kASIg9weX5yy3kTeZT2BWZXKS5xJMMfU1sMV/QI3XGDykO3vQwxCf0+9w Zdtm101NSjpwLo7uN5E69Fz78nEp8fQFZczh5AqKJnu7vk2FjVbl8FPfQSFfUjuQkyFsdvil IA+3yEigAn4DtlLit9AC/QEpDtY= X-Mailgun-Sending-Ip: 198.61.254.9 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-n02.prod.us-east-1.postgun.com with SMTP id 6094446dc06dd10a2d4e07d0 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Thu, 06 May 2021 19:33:01 GMT Sender: bbhatt=qti.qualcomm.com@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 791C4C43145; Thu, 6 May 2021 19:33:00 +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, URIBL_BLOCKED autolearn=unavailable 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 EB06CC43143; Thu, 6 May 2021 19:32:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org EB06CC43143 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=fail (p=none dis=none) header.from=qti.qualcomm.com Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=tempfail smtp.mailfrom=bbhatt@qti.qualcomm.com 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 v4 2/6] bus: mhi: core: Set BHI and BHIe pointers to NULL in clean-up Date: Thu, 6 May 2021 12:32:21 -0700 Message-Id: <1620329545-32328-3-git-send-email-bbhatt@qti.qualcomm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1620329545-32328-1-git-send-email-bbhatt@qti.qualcomm.com> References: <1620329545-32328-1-git-send-email-bbhatt@qti.qualcomm.com> Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Bhaumik Bhatt 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 Reviewed-by: Hemant Kumar --- 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