Received: by 10.223.185.116 with SMTP id b49csp1096321wrg; Fri, 23 Feb 2018 11:52:36 -0800 (PST) X-Google-Smtp-Source: AH8x224QnyJkn8iTQPM32M7TX0uDltwVB8mf7CSl4BDFwC54k/+TasSD20B/6KsdPe7VIn89tjiT X-Received: by 10.98.97.198 with SMTP id v189mr2861410pfb.110.1519415556237; Fri, 23 Feb 2018 11:52:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519415556; cv=none; d=google.com; s=arc-20160816; b=JbLRJvU0kVtAEBvCE2ve+yRRVdcRa+tg8QJK4HCyQ8+9PFL8BT2/YT5qDpM9zyWSE8 WziSn/cFWRj1gp7NungR4+n2QGhljPVVVyM/s+AsWE95KV1zcFqenbdi5MUS1TdQNBfj nak6mSFt2X7fpPqgs/eMgLk+vs8FybvaiHaE4Pg3NXc/tOlNtH2cGp+5KAXeVPDT8Trk JauHnrlVeI3qAQlbnglDnr8cgEJH0l2xpiE8q9p3zDMrd1ZOqLyucH8Uk2TjOvHBUT0e fTxbW/H3svTFWadBLS0WORHaVeiJseyuxYZUz2JCKvU9HAtKsoiWKefIjN3fIpyAg0EN xC2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=YI5LyagHJzo9fRL8Spm2F7zMA0z617/CUeS4uk/+eMk=; b=UsAHHMWcga3yXjbjmWqDmJh+v9+jrucoWP0hEYqw/Wakrssgdywbq/g2ux9Nzf3Pf0 y/38MadpbvpcqqM5r7rU+tTbNgpRRFsQWNyl5OmGUXu9uQ/svp8fFb9QcLViIPbJohdC /x+8R8nsqSZrHV+wWiLKpZ0lYW6XAgF3mVJ00+mPE0qVf0PaUNNHZKoCwVvK4de71tkB M7bCHfPt8UmRzEy1UQjoswlzYV0WAGodzD3Iwjd+rVHdrQh9IlO1j5h4MOChyEjybChx my+o7njurcGSqxXNw+I00HKNnXk26ilNtbpjARQXkjspGNZo8YIswIvSgND33OXZ8u4b Mf2w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x33-v6si2189901plb.477.2018.02.23.11.52.21; Fri, 23 Feb 2018 11:52:36 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933911AbeBWSqB (ORCPT + 99 others); Fri, 23 Feb 2018 13:46:01 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:43510 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933587AbeBWSp4 (ORCPT ); Fri, 23 Feb 2018 13:45:56 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 7B5171244; Fri, 23 Feb 2018 18:45:55 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andreas Platschek , Felipe Balbi , Sasha Levin Subject: [PATCH 4.9 081/145] usb: dwc3: of-simple: fix missing clk_disable_unprepare Date: Fri, 23 Feb 2018 19:26:27 +0100 Message-Id: <20180223170735.219699098@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180223170724.669759283@linuxfoundation.org> References: <20180223170724.669759283@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Andreas Platschek [ Upstream commit ded600ea9fb51a495d2fcd21e90351df876488e8 ] If of_clk_get() fails, the clean-up of already initialized clocks should be the same as when clk_prepare_enable() fails. Thus a clk_disable_unprepare() for each clock should be called before the clk_put(). Found by Linux Driver Verification project (linuxtesting.org). Fixes: 16adc674d0d6 ("usb: dwc3: ep0: fix setup_packet_pending initialization") Signed-off-by: Andreas Platschek Signed-off-by: Felipe Balbi Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/usb/dwc3/dwc3-of-simple.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/drivers/usb/dwc3/dwc3-of-simple.c +++ b/drivers/usb/dwc3/dwc3-of-simple.c @@ -58,8 +58,10 @@ static int dwc3_of_simple_clk_init(struc clk = of_clk_get(np, i); if (IS_ERR(clk)) { - while (--i >= 0) + while (--i >= 0) { + clk_disable_unprepare(simple->clks[i]); clk_put(simple->clks[i]); + } return PTR_ERR(clk); }