Received: by 2002:a05:7412:8d23:b0:f7:29d7:fb05 with SMTP id bj35csp468831rdb; Sat, 16 Dec 2023 17:13:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IFjMSUnvUovPwrsIML9Z4zmk/YBZwVoUlus43VkSIQuyF4aCtWFZmkLdt9QakKKgCUYevQw X-Received: by 2002:a05:622a:1a23:b0:425:8f31:2913 with SMTP id f35-20020a05622a1a2300b004258f312913mr17958647qtb.35.1702775615179; Sat, 16 Dec 2023 17:13:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702775615; cv=none; d=google.com; s=arc-20160816; b=zeL0NKxDGRRa1qtPy0RzkOfYG3gsiWO8AFs37r6NtEKL/bX0aQuIFg59e5erRz3cH+ jaBAurl0eLayI6TD49Nvd7c5Z1uEUiVucyfhW8l6gX+qiBQnGs8eJC94spnJ5LzWuqCA wIntfq2yB4IjVuvX3YVkJ9FI3lEE6d+pXvarqESHSt8nuhmIlmXAt2l6PJZXCXuTzeYp iaaC7nv2ZPj4hvlONPs08hXtDppJoaECq19Rl+xpEGe7SVrmD7wTmVj076KHlChW5Awe z8jroyfn10ZhElHNpcSLzbzn23xdd8+foVXIFIxJYGSy7xylzaBQzPFcVzUJKGNxHE27 0SBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:date:to:cc:from:subject:references:in-reply-to :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:dkim-signature; bh=AxnDyTzaBhyrkBIleqLu77K26uIARMbwOapVhxy1RUg=; fh=UhTof2M4fjRn33nE8mYii5Wlh7HxeqSyaiyXnpI2yvI=; b=twiznLnVd5Oij/imI9HdvFICC3iHrmBb2K78bG/J2d2eXvEoLgaXJkNH2gq+7ECRiw OTHxs2Z9u725Pm/1wT40/gTnLI6B7kRQX0n2batM3STSkXNo2Ux3S5gVMSGcZ7F/7TFQ fkAv5MjlsA51tIcRjevzIT/hkoD1JBuIFpZxMFTWLAEpM+K7iTRNoIXqEFSDrTqynUXM 9OYrtA7kEuAz+zPyICN2SMOpelkONobvPsf/rJWTv0X7HJw9IKV63n81HRa79iaciwr/ h8VpTr/mBQWR4k/Jobdpp1tWwPlh+VlAzVCv67D7D4u/1nsiOKd4/Jn7lwsYxY85igQw drEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=d4iCYiS2; spf=pass (google.com: domain of linux-kernel+bounces-2426-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2426-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id j13-20020ac8440d000000b004254e6b898csi19388890qtn.578.2023.12.16.17.13.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 17:13:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-2426-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=d4iCYiS2; spf=pass (google.com: domain of linux-kernel+bounces-2426-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2426-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 99D1D1C2176F for ; Sun, 17 Dec 2023 01:13:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EF7EE1854; Sun, 17 Dec 2023 01:13:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="d4iCYiS2" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 23BB11852; Sun, 17 Dec 2023 01:13:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A446EC433C8; Sun, 17 Dec 2023 01:13:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702775590; bh=AxnDyTzaBhyrkBIleqLu77K26uIARMbwOapVhxy1RUg=; h=In-Reply-To:References:Subject:From:Cc:To:Date:From; b=d4iCYiS2bBYdTgvjHzzE6bwlXyUjUGo4v3L4d/e57hZvoDN658d++Tcnm2ENKa8SZ 7dUJr8hys/XHcgvVQOwXDMCNM2jcBXEmdUVGYr22Gt6pp0vhzx1BHlyomoZ+VnBHz5 0O8E0Q7+hyVk4YNG9zV7HuiIQmUKNsrPo4lJ4iy1CSWAvcDn7vMk1ZHGTX7mqKE3ae nVHKZb0+d40uILKB4ymJMR+G9NuP3cytkM7T/xERVgqgMEr+jRiZtTwrkyoMoA5i5n dI1LzQRqCpDkcjwH/3q0qUKPziNEeA8I/pd+/zBtYENiJemnPCS/ckgtXYUQeSLfnH RsqMgFk11F43A== Message-ID: Content-Type: text/plain; charset="utf-8" Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: <20231210165040.3407545-1-visitorckw@gmail.com> References: <20231210165040.3407545-1-visitorckw@gmail.com> Subject: Re: [PATCH] clk: hi3620: Fix memory leak in hi3620_mmc_clk_init() From: Stephen Boyd Cc: robh@kernel.org, abel.vesa@linaro.org, dinguyen@kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Kuan-Wei Chiu To: Kuan-Wei Chiu , mturquette@baylibre.com Date: Sat, 16 Dec 2023 17:13:08 -0800 User-Agent: alot/0.10 Quoting Kuan-Wei Chiu (2023-12-10 08:50:40) > In cases where kcalloc() fails for the 'clk_data->clks' allocation, the > code path does not handle the failure gracefully, potentially leading > to a memory leak. This fix ensures proper cleanup by freeing the > allocated memory for 'clk_data' before returning. >=20 > Signed-off-by: Kuan-Wei Chiu > --- Applied to clk-next