From patchwork Thu Oct 5 14:00:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 13410087 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 73732E92700 for ; Thu, 5 Oct 2023 14:01:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Subject:Cc:To: From:Date:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=zRO8/0UR8B9fVrpKDvRO3HpsIWq36ANYa9lDld4qAbY=; b=LdEXeg+m9pT2SK fOWC7wt69W+I5yRbHRTIqHaF4SBw8PRavwMM588/wAWeU3i8upO2rSrc+kwFkht+oG1ST8XROlBsT oHd6MufXbvzxJ17p22R54KtVFHslIj7sbhr04DsUw/DmXPIV1hvo+EvdlpwavZOHqPov6CvwoLHDq 41OpaOZWQe6+VoeniJ7wJSUNXKhOFPoZDaURzX+9LeztR8H3llQFdJ3C0Vy8DZayhYm9+QmtKnJ0d gXpLWiFsCPZPIxgLHbGRae9Xd9UiiohzwYOf+L8hMecOHa/KE7EM6KztJTHJlCOTXz5EVcWkfDUiQ WnTo8C0+OUxbSvfBmyyQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qoOu3-003eZV-0N; Thu, 05 Oct 2023 14:00:35 +0000 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qoOu1-003eY6-0I for linux-arm-kernel@lists.infradead.org; Thu, 05 Oct 2023 14:00:34 +0000 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-32320381a07so1051351f8f.0 for ; Thu, 05 Oct 2023 07:00:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696514428; x=1697119228; darn=lists.infradead.org; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=Bq6Al0uhdqE8dyQRZT83/DywvErgo4yew/KdSq0MhvE=; b=yIVPoVNnmR3FbCm5O/UW0HonRu7auWFmqZDUDlON+tdXJm3vB3Ep0KcZvX0a5RD89z h7lDLSIPlyqedoLUf8vhwrBM9aHDT48CLq1YLAOyA0qCUp0k2v5YQGVQ7qHUBOXAZ/0k Dch6ZHU78GYQF3ZnI35DeMiOIZNvTgdo5e0h5cib9bdP24af5AM6B4cdS/8XS4Y6Jq/w qesqN6t01U9OuWVlKw0LuxM9xOU+K0MJ23CCGJFDpR86hZzRgq30Qk6XEhNKdoe2Tr97 4O+4QgsgE0UhnKI61813Uq3eo8dRol0/w0hKaViQ3PcOXGj5z0Gt2Eikm3ZyJ2rTLSaZ DRzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696514428; x=1697119228; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Bq6Al0uhdqE8dyQRZT83/DywvErgo4yew/KdSq0MhvE=; b=VPdcH4qLLZatFtthsaMRL5VTnQpkAGj80w1tduDCTClkF2mzkcNKxPGuly3/wf776p zdDQb/qF6idvBvea+3bmUquvPEyEw/1++3V97GEWD147rrM1cAqn9gLENd2tfmamkymd vqcCn9VMUyhQz3opYPV/r+aFjsoXtbpi/j/b7jVWVGBvW9vUlBNjz8+Uw2fByUQD4Fqe zVSpN2WSsvrY1EAdRt1tA55sPVGGgT7IhqlBYD0NRIjtAfSQExfAe3YuZmlRt/AKrtj2 M7ka53Uk2yk9Jfziv3+hlS4yBIWjCNoGHAifT6fnIAfduqzReMOfTnO5twwQLdjVaXYQ 6rwA== X-Gm-Message-State: AOJu0YzPXQxfvUctQDTnXgWoRnhXMiUOJW534iSobfYL4ELf6CpWdZs3 E1oVVWDdgVVfIab3fRgA5Pe+Ug== X-Google-Smtp-Source: AGHT+IHwNsl3R2+inwJL9KG2n8GmwjwPTWGIpRhvHpykm2Ag3TFC5h678lIY/dcNTTM8eNFy6XA3Eg== X-Received: by 2002:a5d:4149:0:b0:31f:eb8d:481f with SMTP id c9-20020a5d4149000000b0031feb8d481fmr4870624wrq.29.1696514428084; Thu, 05 Oct 2023 07:00:28 -0700 (PDT) Received: from localhost ([102.36.222.112]) by smtp.gmail.com with ESMTPSA id da4-20020a056000196400b003176c6e87b1sm1856481wrb.81.2023.10.05.07.00.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Oct 2023 07:00:27 -0700 (PDT) Date: Thu, 5 Oct 2023 17:00:24 +0300 From: Dan Carpenter To: Daniel Mack Cc: Haojian Zhuang , Robert Jarzmik , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , linux-arm-kernel@lists.infradead.org, alsa-devel@alsa-project.org, kernel-janitors@vger.kernel.org Subject: [PATCH] ASoC: pxa: fix a memory leak in probe() Message-ID: <84ac2313-1420-471a-b2cb-3269a2e12a7c@moroto.mountain> MIME-Version: 1.0 Content-Disposition: inline X-Mailer: git-send-email haha only kidding X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231005_070033_141452_B36105FA X-CRM114-Status: GOOD ( 14.35 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Free the "priv" pointer before returning the error code. Fixes: 90eb6b59d311 ("ASoC: pxa-ssp: add support for an external clock in devicetree") Signed-off-by: Dan Carpenter --- sound/soc/pxa/pxa-ssp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/pxa/pxa-ssp.c b/sound/soc/pxa/pxa-ssp.c index b70034c07eee..b8a3cb8b7597 100644 --- a/sound/soc/pxa/pxa-ssp.c +++ b/sound/soc/pxa/pxa-ssp.c @@ -773,7 +773,7 @@ static int pxa_ssp_probe(struct snd_soc_dai *dai) if (IS_ERR(priv->extclk)) { ret = PTR_ERR(priv->extclk); if (ret == -EPROBE_DEFER) - return ret; + goto err_priv; priv->extclk = NULL; }