Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp723624pxu; Thu, 15 Oct 2020 15:05:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyWo25ISs3wxgvsLy6arHDpL6hI3ka6IFNljpxlfimARAAFmop1chEClpIQOfksHs4ZiHQw X-Received: by 2002:a17:906:1d53:: with SMTP id o19mr517260ejh.468.1602799541589; Thu, 15 Oct 2020 15:05:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602799541; cv=none; d=google.com; s=arc-20160816; b=r9ODyrP+brPtsEQBaBGhC8ZE1VpgTqOxM7Pyh55XvVc8nQAW2juG2hDMkMadsuMKAP stPBfwzFuGD5unNUuSAMumNDhdW9TiP9lbDgku9C46KeXhagiO9PcFMyHcPKk/TyaKb3 XmymXUYxPVeAWS/EL0Y29hDIvFM3rJpE8eIamrbKwXVe/XX+31iV0A/zxWLNtCJNfPYD 873LXm2lroSbQTo64csAnENLoE9SJhgplfzd8pH3kVwFmQVTvvOFfpm3NAZQMc8onAsw RWTvgEWp5wRIAgWvLobrvpaZ8jzWGo7rzLohg+TZWWxFyBrpVmAT+trypqbiJWqvuwLF gtZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from:dmarc-filter :sender:dkim-signature; bh=B8lOXAcm+/ugLwAWCtJF7DzjnDIgFnngZ2Vc5EQ5emA=; b=VBylFdeD0lZJzGKRAzOYSb5bU/5ZnUKFAsdTY1GosW/40j925TfNij4ybxx7iaPxti iM91aYEENjabjKGSDEjrIxN8QmFSmkiNQkgDZcM32YT/XN46NxVrmxIPl8MYr4z5NiWL RwKEtlN+lq7IR5qpSdzf7CjnOqWeFC78h5iri/Sez52pBYJhMolxAuCJzbs0ju7kwkTj YzNq5U75ReBgAu3tsfKxAWEQ0F9D4HFV2h1P6d8ts3BlXiVnWdHg2uACuZlqT2GPjDVE KZxQ+PhjMhwnZfhX8y6GtZAyryS9gRWOXPnnAEd01rosoU7vatSn5kq2a9vEgJJ5epli kDWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=BAPF6Y4W; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 bu25si162157edb.438.2020.10.15.15.05.18; Thu, 15 Oct 2020 15:05:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=BAPF6Y4W; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389834AbgJOSsB (ORCPT + 99 others); Thu, 15 Oct 2020 14:48:01 -0400 Received: from m42-4.mailgun.net ([69.72.42.4]:12452 "EHLO m42-4.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726823AbgJOSsB (ORCPT ); Thu, 15 Oct 2020 14:48:01 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1602787680; h=Message-Id: Date: Subject: Cc: To: From: Sender; bh=B8lOXAcm+/ugLwAWCtJF7DzjnDIgFnngZ2Vc5EQ5emA=; b=BAPF6Y4Wzt5QW/fJQQGKA20Wxy+6IaqXLiybax6n/IlCqqw5k1CmZEVbvfdvlKB35uprhFR3 tcDBzdAIBf++j5Zpwed8HAlhPCtSHXlOyhd7hMypXE7pB401gkGlMKwiC39dyQOrocXOtLRA pemZ2yaB9dw+kSx8AOiqFoZzIEA= X-Mailgun-Sending-Ip: 69.72.42.4 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n06.prod.us-east-1.postgun.com with SMTP id 5f8899603711fec7b105cf67 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Thu, 15 Oct 2020 18:48:00 GMT Sender: bbhatt=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 531D0C43382; Thu, 15 Oct 2020 18:47:59 +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, URIBL_BLOCKED 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 62367C433C9; Thu, 15 Oct 2020 18:47:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 62367C433C9 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, skhan@linuxfoundation.org, Bhaumik Bhatt Subject: [PATCH] bus: mhi: core: Remove double locking from mhi_driver_remove() Date: Thu, 15 Oct 2020 11:47:51 -0700 Message-Id: <1602787671-9497-1-git-send-email-bbhatt@codeaurora.org> X-Mailer: git-send-email 2.7.4 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org There is double acquisition of the pm_lock from mhi_driver_remove() function. Remove the read_lock_bh/read_unlock_bh calls for pm_lock taken during a call to mhi_device_put() as the lock is acquired within the function already. This will help avoid a potential kernel panic. Fixes: 189ff97cca53 ("bus: mhi: core: Add support for data transfer") Reported-by: Shuah Khan Signed-off-by: Bhaumik Bhatt --- drivers/bus/mhi/core/init.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/bus/mhi/core/init.c b/drivers/bus/mhi/core/init.c index 0ffdebd..0a09f82 100644 --- a/drivers/bus/mhi/core/init.c +++ b/drivers/bus/mhi/core/init.c @@ -1276,10 +1276,8 @@ static int mhi_driver_remove(struct device *dev) mutex_unlock(&mhi_chan->mutex); } - read_lock_bh(&mhi_cntrl->pm_lock); while (mhi_dev->dev_wake) mhi_device_put(mhi_dev); - read_unlock_bh(&mhi_cntrl->pm_lock); return 0; } -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project