Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9080535pxu; Mon, 28 Dec 2020 06:10:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJyP4QZWpQU5kS8NMYRIKQXqaaplzu4Yr4tgMMOsam8a07ozi0AvLJQ72e5Gkk+n7KSLPTDu X-Received: by 2002:a17:906:31cb:: with SMTP id f11mr2554505ejf.468.1609164621439; Mon, 28 Dec 2020 06:10:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609164621; cv=none; d=google.com; s=arc-20160816; b=NaggqjTRKXD+aqgYUmk1WohbzsK20akGRy7Bn2l/ZbRGzO1gV4zetle9MdH4HLc1lA rw4Lhy+jZIV77kRFJnYC7+DQybQRQjDVpiVVdsGWTi9tuPyKElpx9CX18J7lU1YeEl9L UMELWMx9p3lzqWc2yjKJvZ6qCxQgYJQYX8gkaKalGbAiDhE5evqcRSJ3DKPnuii5YO/g D0QBWoSq0WaACW60kpR1+Xe+dVRSOVrTS3FReufQ6twFy4jgH2Ek3tjEjm/bFXkYxrMF jE+G+4+cPKDO9GG5YCIHfdOS0kp0HUzUD6RShj/RSRhy5Iiu00XWYJaBBzrwd5jg8riz m3LQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=hCulaSjoktQ2WhtM0Welj3NeLJDaRGtipe7NnW+erB0=; b=nhV7mAVhmBNBlOiJKcDrHUQdFkStFeRSy9yoTn4DqoO7xB+EPvdklkUFXVk40rZzuv ngiTj4H063RZG0XZxkTTof4U+59qAv6bdiMFpA1Jj4NxEP9DYYkzSSVjt6OvR++rWK0L uVKJZdcTHRL2IWBE0DjRWLxtpu56NRN2OdJ5YMd+BSYti06mH1EkC810hpNf9v9xK34U MNBwkPu185UisyaT+oNyyncAXrtIwSaQaSzg1SzRWqSml+lwUiXOuzrt1n1eXp7R04Vz q6+7DUw1X/dOw2ALtsfa+Qp37loAKsLT72mvcSfGZuSqjBXkraUu+yuaqpubpF5SYgOV dKpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=kZVsb8Yp; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y24si19861737edv.565.2020.12.28.06.09.59; Mon, 28 Dec 2020 06:10:21 -0800 (PST) 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=@linuxfoundation.org header.s=korg header.b=kZVsb8Yp; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2438592AbgL1OIH (ORCPT + 99 others); Mon, 28 Dec 2020 09:08:07 -0500 Received: from mail.kernel.org ([198.145.29.99]:42520 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2438552AbgL1OH7 (ORCPT ); Mon, 28 Dec 2020 09:07:59 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 22B2C207A9; Mon, 28 Dec 2020 14:07:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609164438; bh=AxZ1D9jaJpTHEJNzorAHIOzHbl+64PHdoIc9ZvZPfj4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kZVsb8YpnIPg5HY4ukDa5/u0Uoay6p5iUFqRPIvp2Ld/EiH85+dP5UkryFgFxWYsK 5WamNLom0w1Z8guDZ4aQpmZxGTpmydXJR+nfD4JsVEu3WbReIsNWE6dP7t3L18bA2i PSow6mcgB1jqPfTnz8QL9oMSVuyNsTO5v85kCotE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Shuah Khan , Bhaumik Bhatt , Manivannan Sadhasivam , Sasha Levin Subject: [PATCH 5.10 150/717] bus: mhi: core: Remove double locking from mhi_driver_remove() Date: Mon, 28 Dec 2020 13:42:28 +0100 Message-Id: <20201228125028.151067722@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228125020.963311703@linuxfoundation.org> References: <20201228125020.963311703@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bhaumik Bhatt [ Upstream commit 9b627c25e70816a5e1dca940444b5029065b4d60 ] 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 Reviewed-by: Manivannan Sadhasivam Signed-off-by: Manivannan Sadhasivam Signed-off-by: Sasha Levin --- 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 0ffdebde82657..0a09f8215057d 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; } -- 2.27.0