Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1772251imm; Thu, 27 Sep 2018 02:11:49 -0700 (PDT) X-Google-Smtp-Source: ACcGV62jWWjckgpSemqsWxsJ7JF82wRrwaNInELcL1Bp9qI2T2yz5j/nK0KFZTnAjP2XqId872og X-Received: by 2002:a63:9855:: with SMTP id l21-v6mr3534335pgo.162.1538039509036; Thu, 27 Sep 2018 02:11:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538039508; cv=none; d=google.com; s=arc-20160816; b=yYrVxSaGk3LlEL48gEtiPT98oC/5kf2By+sG70mEgZRZi0bPEZzyoDlSFeQeFd5Fs/ 1/DSWIhpGNX6AwMJU97NKia2KRMmoOcWjiIL8Oc5E4E47L+X4Ffqskyh8YvGR28Q3Llq kRoKvL+78W6Hfza6DnKoCgi1+Oxy2xVJYJxOJOvnD4hHGwYOVRYXBs5vrRJ2lUE8Lhit aTZZnHQbg3uWHbfLpc9TP5k1RmMc9Hy3kIBsL3OZkHLTOYfPyKae1f5XEvcVIsO+qIlJ 96gwYdx7L9UOecBMzte6hcp+FebB/gfSopsDFSJuCBb0u7jwmsh0Ns4mIYLw3w2tBdvB c8zw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from; bh=y0xJrobwbq/27Y+HAfJS3//wWhahb2E1nkK8oqRW5bc=; b=CzK8JmsHitdl+IlgDLQOsOqiZUENKzZ8etucazdsSuLhskvC/VC2gc4TKstQJb7twO WXaATeu2y0cwtRtGpPL0+D+DLYK0qFfmFfj+kWtX3JKarI48WAjsNOjA7nlZBupvWAoy 20+Xr5pgzSb3dHjIeYppJEeWX3MoAICCykDdifG3oPvhb8fnxxrBSvCNmLjt0wYl+amX CDOLhiwDKUbvmxSLRymHrkx8WhN3kEGf3GDUyjWQys/QujXyfK4E8DfjCgr2KUBYG22B YJnzO3wo+b/cM6ezO1ugm5zqw2TAhuyh6Hf+WmHKJS3j2xSQKeeNYFdUucXzWw0BrTdB Sptg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b12-v6si887645pgw.668.2018.09.27.02.11.33; Thu, 27 Sep 2018 02:11:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728278AbeI0P0o (ORCPT + 99 others); Thu, 27 Sep 2018 11:26:44 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:55058 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726962AbeI0P0n (ORCPT ); Thu, 27 Sep 2018 11:26:43 -0400 Received: from localhost (ip-213-127-77-73.ip.prioritytelecom.net [213.127.77.73]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id CCAEF1116; Thu, 27 Sep 2018 09:09:28 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Takashi Sakamoto , Takashi Iwai Subject: [PATCH 4.18 33/88] ALSA: fireface: fix memory leak in ff400_switch_fetching_mode() Date: Thu, 27 Sep 2018 11:03:14 +0200 Message-Id: <20180927090304.614694603@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180927090300.631426620@linuxfoundation.org> References: <20180927090300.631426620@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Takashi Sakamoto commit 36f3a6e02c143a7e9e4e143e416371f67bc1fae6 upstream. An allocated memory forgets to be released. Fixes: 76fdb3a9e13 ('ALSA: fireface: add support for Fireface 400') Cc: # 4.12+ Signed-off-by: Takashi Sakamoto Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman --- sound/firewire/fireface/ff-protocol-ff400.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) --- a/sound/firewire/fireface/ff-protocol-ff400.c +++ b/sound/firewire/fireface/ff-protocol-ff400.c @@ -146,6 +146,7 @@ static int ff400_switch_fetching_mode(st { __le32 *reg; int i; + int err; reg = kcalloc(18, sizeof(__le32), GFP_KERNEL); if (reg == NULL) @@ -163,9 +164,11 @@ static int ff400_switch_fetching_mode(st reg[i] = cpu_to_le32(0x00000001); } - return snd_fw_transaction(ff->unit, TCODE_WRITE_BLOCK_REQUEST, - FF400_FETCH_PCM_FRAMES, reg, - sizeof(__le32) * 18, 0); + err = snd_fw_transaction(ff->unit, TCODE_WRITE_BLOCK_REQUEST, + FF400_FETCH_PCM_FRAMES, reg, + sizeof(__le32) * 18, 0); + kfree(reg); + return err; } static void ff400_dump_sync_status(struct snd_ff *ff,