Received: by 10.223.185.116 with SMTP id b49csp1046720wrg; Fri, 23 Feb 2018 10:57:33 -0800 (PST) X-Google-Smtp-Source: AH8x225f/DEUj8/zjYeKpHYQlx33h3VeC7ZR0cHXMyuQRP2ne6j3nh35oTZCMIXlix6ETrirDMQg X-Received: by 10.98.67.157 with SMTP id l29mr2694941pfi.214.1519412253580; Fri, 23 Feb 2018 10:57:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519412253; cv=none; d=google.com; s=arc-20160816; b=swyZQclBDuix/Qs4Nmf0ZabxsHE0ytY7c1uWIE10R8ZZUCPysjQCcthM6eWEpTIcsc nVoJBxLUU4DlrJtp1Hgu6P9x78MnN7Jq8MoIQvsB3iwHK7UvhMtMyhIZOxMztyqtXweB aDjPGjVnTBP8nljv/x7AIso7cuoCCkpRsvp4avfFmcJLVWVWR95PYY5t3eJbqorMSf4A r8PF2ioC7F11eBWlf9po/SiDjkw2ad5c4K72QqjW/AWwRT36XtJ825Lpv8x+k2mDz+hy 7qitakQJQbJKrj8QxaSuDlH94odAHRA7hFjNyZFPqSTES5Bezaf2GdBw5Jr1viTaARyy NDgA== 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=5Xwq+6pLCCop2yiW1A+qW4T6KHM2J1a0twtDr8KFKvM=; b=BxIDsWGOmiNHlrdkDZrvitQsqXAuNiuCStsnuDzxkT01ApWQDr8tig69vRhldG9v+M 3K+jmibRAeCCFUUsVd9AHe5cRGSEKpi9ISYXjhGpT0o5sqTin+JjSNWYp3/3ed7DZMsj vaHtoNJbwDB/AhhVhtiCYxyfTye6QK1EsNUWZrfGimlZulje+u3eEu6IWKDhIuwoIWg4 CrmZ9nJMsrguh+6Xx9LxFttEWl9cRpzCv+aoo+ryiADdLK2/JPaLffdEGcXdFXVVM0PC 1EoNIhwnC5WtOd2PTnX9Cc/PLdaBRbsVChCkwNEw/uEi1cRGes6dMRvO6ZMEaUnvXBzb dlOw== 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 t8si1823005pgu.454.2018.02.23.10.57.19; Fri, 23 Feb 2018 10:57:33 -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 S965252AbeBWS4I (ORCPT + 99 others); Fri, 23 Feb 2018 13:56:08 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:48498 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965199AbeBWS4E (ORCPT ); Fri, 23 Feb 2018 13:56:04 -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 DC63E1257; Fri, 23 Feb 2018 18:56:03 +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.14 146/159] usb: dwc3: of-simple: fix missing clk_disable_unprepare Date: Fri, 23 Feb 2018 19:27:34 +0100 Message-Id: <20180223170800.632976786@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180223170743.086611315@linuxfoundation.org> References: <20180223170743.086611315@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.14-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 @@ -57,8 +57,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); }