Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1773178imm; Thu, 27 Sep 2018 02:12:52 -0700 (PDT) X-Google-Smtp-Source: ACcGV61GIAqLv3eqExd0PtLr0DD82sb2A4v22s9x4LcBIY+V1Fljy/LgIhHEg1FAbi8fuWVIu8m1 X-Received: by 2002:a62:1a16:: with SMTP id a22-v6mr10245392pfa.237.1538039572645; Thu, 27 Sep 2018 02:12:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538039572; cv=none; d=google.com; s=arc-20160816; b=zrRL9Fr6x9cffnrlhNH00UsgqU324sFgpOGZMc0zws3YiyCzH/pAUNPp4yERjH4iOi DNVc40jpFHrrevpu82/cwCTw878ACo6P4uDwzhK43FNZtb6ybhdGyeKUk5gbX+E2qBb7 8kANz9ghoQoeEDBGrBEK6hIcrhWHtHPQsjyRs4FTEsAlcAYEua10tOMq/AGXaBKs2fRq 61QdmDSd6tIedElELtuT69SS9ph5e+tF4Xvo1j8QYIN1eyKNRikAdmFtJcKelRXuTIhD n6gt9RiaN+tz8iJ+bm/Bv2MuhVh/3BrlSszV/iJylEgCU4+a14nB8m/wXdeRx95KjUX0 OUdw== 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=3uKjay3gS/IFZWA/vwj4J5W6s0Rn+6vmHl5t8WKGXbE=; b=eAshfEcyGxlDM1kiapWAjL6Xr/8l74EsQwe8JLb8w5TClp6lw6unlUkU635vDTXRpC oikd7ZqZZmASIo0CfLtMHNwQR3EKJeMjKtY3iyMknh54ulorLXKtPvYmQ242w15KT36C Tw6eSuton0pFJBxsbhBrFWDgChcCErdJWyczp6ksjK4HxmiLXVQoKRGP3BmwRDhNQE1M C6Q2ut7EjJAV4JGvZJWeA9/d8hXV7yNixwzzrcLyYd1VObTP9nJxpUX4MR5DK31qFQqn HGIDd9ju5oUnleKgECYSsXJz8UfDgTEAgcrrwhMxX4roQia0B1Kac28exrnQpXB+jioB PjjQ== 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 f5-v6si1410187pgm.581.2018.09.27.02.12.37; Thu, 27 Sep 2018 02:12:52 -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 S1728427AbeI0P1t (ORCPT + 99 others); Thu, 27 Sep 2018 11:27:49 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:55158 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727294AbeI0P1s (ORCPT ); Thu, 27 Sep 2018 11:27:48 -0400 Received: from localhost (ip-213-127-77-73.ip.prioritytelecom.net [213.127.77.73]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 5CE3710A4; Thu, 27 Sep 2018 09:10:32 +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 37/88] ALSA: oxfw: fix memory leak for model-dependent data at error path Date: Thu, 27 Sep 2018 11:03:18 +0200 Message-Id: <20180927090305.126459255@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 ce925f088b979537f22f9e05eb923ef9822ca139 upstream. After allocating model-dependent data, ALSA OXFW driver has memory leak of the data at error path. This commit releases the data at the error path. Fixes: 6c29230e2a5f ('ALSA: oxfw: delayed registration of sound card') Cc: # v4.7+ Signed-off-by: Takashi Sakamoto Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman --- sound/firewire/oxfw/oxfw.c | 2 ++ 1 file changed, 2 insertions(+) --- a/sound/firewire/oxfw/oxfw.c +++ b/sound/firewire/oxfw/oxfw.c @@ -270,6 +270,8 @@ error: if (oxfw->has_output) snd_oxfw_stream_destroy_simplex(oxfw, &oxfw->tx_stream); snd_card_free(oxfw->card); + kfree(oxfw->spec); + oxfw->spec = NULL; dev_info(&oxfw->unit->device, "Sound card registration failed: %d\n", err); }