From patchwork Fri Sep 18 10:32:20 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudip Mukherjee X-Patchwork-Id: 7214911 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 2B7F9BEEC1 for ; Fri, 18 Sep 2015 10:33:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 67A472094B for ; Fri, 18 Sep 2015 10:33:46 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 361FD20948 for ; Fri, 18 Sep 2015 10:33:45 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 3B04E265D7E; Fri, 18 Sep 2015 12:33:44 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, NO_DNS_FOR_FROM, RCVD_IN_DNSWL_LOW, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id F2F95265A39; Fri, 18 Sep 2015 12:32:46 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 2F331265A73; Fri, 18 Sep 2015 12:32:46 +0200 (CEST) Received: from mail-pa0-f51.google.com (mail-pa0-f51.google.com [209.85.220.51]) by alsa0.perex.cz (Postfix) with ESMTP id 49C66260415 for ; Fri, 18 Sep 2015 12:32:35 +0200 (CEST) Received: by pacfv12 with SMTP id fv12so48811487pac.2 for ; Fri, 18 Sep 2015 03:32:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=SB5lzYsAmAC4JpGUMmrfr1KFCSw45bJ1LtnKpRpjsCI=; b=f6VDFwS5W11p8O8WWYRFbqJAN3BY9uKQVfeiLP4h2qMVksV91gtnvcUqnuugbwimNJ AyTGsNrtM5bzfDhg7VNx6Ev3PbiT3fGM/BnYJAXZXC8Cm16rdttM0Iyzzndshzm6PI6y Fb0RXbdv/kLVIL7e26WGpbh8GD2I0sNZjfqhKiDxWC8MahcxVr1hDk0A/1TEUGwAyhJJ wTnED+6cpT4Bea76472Cm4+s6z72v+9dz90Az5/Q2ks6804gK3/IUzjTdKgOHQFOQYmJ 1AvRoH3h5DdC7N4fLoFtwTCMTcVcs/LxE47b1M+6AGAEarglNXEAW8fOMEbS7JtqCTJX oklg== X-Received: by 10.66.191.131 with SMTP id gy3mr6320061pac.113.1442572354621; Fri, 18 Sep 2015 03:32:34 -0700 (PDT) Received: from localhost.localdomain ([49.206.249.64]) by smtp.gmail.com with ESMTPSA id cn4sm8224775pbc.94.2015.09.18.03.32.31 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 18 Sep 2015 03:32:33 -0700 (PDT) From: Sudip Mukherjee To: Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai Date: Fri, 18 Sep 2015 16:02:20 +0530 Message-Id: <1442572341-28201-2-git-send-email-sudipm.mukherjee@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1442572341-28201-1-git-send-email-sudipm.mukherjee@gmail.com> References: <1442572341-28201-1-git-send-email-sudipm.mukherjee@gmail.com> Cc: alsa-devel@alsa-project.org, patches@opensource.wolfsonmicro.com, linux-kernel@vger.kernel.org, Sudip Mukherjee Subject: [alsa-devel] [PATCH 2/3] ASoC: wm0010: fix memory leak X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP We have requested for the firmware but we have missed releasing it both on success and on error path. While checking the code it turned out that the requested firmware is not even used. More over the same firmware is being loaded by wm0010_stage2_load(). Signed-off-by: Sudip Mukherjee Acked-by: Charles Keepax --- sound/soc/codecs/wm0010.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/sound/soc/codecs/wm0010.c b/sound/soc/codecs/wm0010.c index 79a7cd3..4947be5 100644 --- a/sound/soc/codecs/wm0010.c +++ b/sound/soc/codecs/wm0010.c @@ -577,7 +577,6 @@ static int wm0010_boot(struct snd_soc_codec *codec) struct wm0010_priv *wm0010 = snd_soc_codec_get_drvdata(codec); unsigned long flags; int ret; - const struct firmware *fw; struct spi_message m; struct spi_transfer t; struct dfw_pllrec pll_rec; @@ -623,14 +622,6 @@ static int wm0010_boot(struct snd_soc_codec *codec) wm0010->state = WM0010_OUT_OF_RESET; spin_unlock_irqrestore(&wm0010->irq_lock, flags); - /* First the bootloader */ - ret = request_firmware(&fw, "wm0010_stage2.bin", codec->dev); - if (ret != 0) { - dev_err(codec->dev, "Failed to request stage2 loader: %d\n", - ret); - goto abort; - } - if (!wait_for_completion_timeout(&wm0010->boot_completion, msecs_to_jiffies(20))) dev_err(codec->dev, "Failed to get interrupt from DSP\n");