Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp518099pxx; Wed, 28 Oct 2020 10:08:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyZSKkpQcfM/zAHXmPnWjSNa0d/UdaxPeQxJHumAg7huB1ty6oapdO99fTTrVKsl714fxh0 X-Received: by 2002:a5d:43ca:: with SMTP id v10mr293173wrr.7.1603904896905; Wed, 28 Oct 2020 10:08:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603904896; cv=none; d=google.com; s=arc-20160816; b=quZvUhXWmNKtyz/RIP0bnkof5TA8YZGDISreJAmkJxR4/tCiF2W3IETLUAqeyLobZu wDLPYE+yjjlxsL53p7AS+X2ASgpB/crnPbp/CRF6tHNRjGudXcj9OGt81eO0vQeQkTzE b2FuzihnnEk7DWgmO4W7xPyaxqV65zHMBBbtQGJP0vY37grEbfFxa2ptPbrGbvT7Q+sx LBweGtxbFM7at7ZyppLRGjzToiyXyLWis8iHRlWLF882p4NRPDKQ4fLm4cQ8WL7MZQ9s hmjODaU6zMMUAEnirs9QciyJcIf/lj9B1Bt1k/mXAR61xtilmkk3m2crCjOcIwtYQiyP rbKQ== 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=kcMd5yl8RAM9zBAjM6HDrlbWjGJfjpoEZxBvn8TSCUQ=; b=vZPJl3W/qjInu2Rro15IAZtI5dZs7DBnFSDsQAY1IlGe7V0mBuFox6lDWA4sZzBZdj m6BmxO7A+KMCiURlKIppiPZs6FJsJ1fLPrzrlWJ1CEoTlUTy5uxZF7NdjzcP0w7T6kCq 8f+CqczEdRs2smSY0a5LN3yR3OMZhFOeGwWfRVASY1l2D2CNbGs1s/KQ+HwgiewVckAx 7ZxgU4qnHpFWpdYHKWiNPpVaLLcDLYOJZ/L09UlBHvipD1YVcc4Xo3yxZD3mQruN6wsF rkjIVfuyzIfHOgg6mlUQmOo8eHYYftDTeTYp1jIgs5AA8KWEaUBKTmlnMaejc0LNj4YV eQAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=CG2jV7Sp; 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=fail (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 r21si3290edo.519.2020.10.28.10.07.48; Wed, 28 Oct 2020 10:08:16 -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=@kernel.org header.s=default header.b=CG2jV7Sp; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1820145AbgJ0RdN (ORCPT + 99 others); Tue, 27 Oct 2020 13:33:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:40364 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1749389AbgJ0Ok7 (ORCPT ); Tue, 27 Oct 2020 10:40:59 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1064020773; Tue, 27 Oct 2020 14:40:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603809659; bh=PwNsTTg+LtHgt4tgNS1aq3jdFXUUQKhY/MbYzvfhcUU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CG2jV7SpHwQmsNrVGcz7OhrzHKriGUSaLjW4/wva6+xLHdoOi6vVjstgQKoF8v96m lqQqHRhGGgDhpWnhCqL5AFcD4EQKpPZh/cbawk4FP5Rv493VmjNGTYAYI/osF1wF5d W0D2b3Jb9U1S5NTblV9z6afUdFFmUXn1r3dOVenA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Navid Emamdoost , Stephen Boyd , Sasha Levin Subject: [PATCH 5.4 274/408] clk: bcm2835: add missing release if devm_clk_hw_register fails Date: Tue, 27 Oct 2020 14:53:32 +0100 Message-Id: <20201027135507.760123034@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135455.027547757@linuxfoundation.org> References: <20201027135455.027547757@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: Navid Emamdoost [ Upstream commit f6c992ca7dd4f49042eec61f3fb426c94d901675 ] In the implementation of bcm2835_register_pll(), the allocated pll is leaked if devm_clk_hw_register() fails to register hw. Release pll if devm_clk_hw_register() fails. Signed-off-by: Navid Emamdoost Link: https://lore.kernel.org/r/20200809231202.15811-1-navid.emamdoost@gmail.com Fixes: 41691b8862e2 ("clk: bcm2835: Add support for programming the audio domain clocks") Signed-off-by: Stephen Boyd Signed-off-by: Sasha Levin --- drivers/clk/bcm/clk-bcm2835.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/clk/bcm/clk-bcm2835.c b/drivers/clk/bcm/clk-bcm2835.c index 45420b514149f..c5486537b9284 100644 --- a/drivers/clk/bcm/clk-bcm2835.c +++ b/drivers/clk/bcm/clk-bcm2835.c @@ -1336,8 +1336,10 @@ static struct clk_hw *bcm2835_register_pll(struct bcm2835_cprman *cprman, pll->hw.init = &init; ret = devm_clk_hw_register(cprman->dev, &pll->hw); - if (ret) + if (ret) { + kfree(pll); return NULL; + } return &pll->hw; } -- 2.25.1