Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp471112pxx; Wed, 28 Oct 2020 09:05:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwv5y4Fgj/UxS66f0CaxCPFmIEDd+9/vyWoFrPrDpXim/Mhx3T+V/rSsATmsXDiib6Fi68b X-Received: by 2002:a50:ef0e:: with SMTP id m14mr8673382eds.5.1603901110962; Wed, 28 Oct 2020 09:05:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603901110; cv=none; d=google.com; s=arc-20160816; b=B879cLYtiQbwEMAZibuHPLcv9OkikPJgiTORRPhiitnBXET663QJuWaYvFzi4cgpc2 hF/PB3jR5RWl+eJiPXkf9E8o7OGAcOTMYuxV0BkUsc1aUdQNf685q8oQIDPz9uLlKAP6 NXLQdPhN2usoiXQp6hg0ES9yxYiETUnHxXFrE57sLp1RO7RgXhSx5POsXpztIN2R5hHq 8vgs8l5ir3Jvu53pa2pTFZYboD927YiV4ywM3+yTTxDcegFviCHpH2lorqkr12WvuHmL 3fknJLDsSHyhRO4jlcVix0cG1yV3+oGLGfe15eTqBgE+vEdo2gvCAvae+/HIMRI4p6C2 jqBg== 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=KrN5SYumgiGO4QcMDyzzTvRv0qmbLOKIzyB8pWQPCl4=; b=bcebbO7UWY7N1v1f1bkYTJk85fyABObRleHXaVD+SclPQc/LL3Y4zo4f6M5RUV5213 HhQ0BzVv5ub+nFiSLLKV8eKaUo6I0KH3WLvNzhVh+yEB481X3xzQeblhsqFnOKq3g07k JjEHkyoXOhU73jPp/ddW2hdfaaFydMxaxwp5ug4bn10gBZvPuVlWHUSowlwOL4mzuPrv IB6tSZKjkRy6ftBjkbWu85sXRregOKmqjBs6diaEQdpFA6wJoQmFjgnD2xjnS4rE/BKp I6uUxLP8Rty0HWrVzZ7+UCJ5DVk+E93KzKysiLO5ZAAm0/FUzsK37A0wjYwwfH/kHl4Q bkiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="ZwJ/Ic9N"; 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 b29si2827715edn.354.2020.10.28.09.04.47; Wed, 28 Oct 2020 09:05:10 -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="ZwJ/Ic9N"; 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 S1814652AbgJ0Q6F (ORCPT + 99 others); Tue, 27 Oct 2020 12:58:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:45752 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1794133AbgJ0PKG (ORCPT ); Tue, 27 Oct 2020 11:10:06 -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 20DBA206F4; Tue, 27 Oct 2020 15:10:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603811405; bh=FSvAIpnhNCNuGvMx00olHNgd0THutUntu+SxvBB86PY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZwJ/Ic9NjzcQmSua8I0JvPbtWcyrJ5qCckDOTdAv2nv0fbuRGzvmwMV2iYV+hbH5G 3ELCRTLHGYL4+4UsKmrMHx1d1WQ6QSHM3gIL7ZmNnTudcKrKc3JIcL2fqlgxWguEQc gnHoEXBso8wz+kAOee7ptBcPf3u7UB0NxzGlSNX8= 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.8 451/633] clk: bcm2835: add missing release if devm_clk_hw_register fails Date: Tue, 27 Oct 2020 14:53:14 +0100 Message-Id: <20201027135543.871854857@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135522.655719020@linuxfoundation.org> References: <20201027135522.655719020@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 011802f1a6df9..f18b4d9e9455b 100644 --- a/drivers/clk/bcm/clk-bcm2835.c +++ b/drivers/clk/bcm/clk-bcm2835.c @@ -1337,8 +1337,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