Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1771975imm; Thu, 27 Sep 2018 02:11:29 -0700 (PDT) X-Google-Smtp-Source: ACcGV634VI4G11AJH/AbYpxudQYR4piPl9dABxu4Vy3Q3bbcTwQkQIRjlTR0XP0UnxdeCSfxHGvy X-Received: by 2002:a63:bd01:: with SMTP id a1-v6mr9312952pgf.12.1538039489568; Thu, 27 Sep 2018 02:11:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538039489; cv=none; d=google.com; s=arc-20160816; b=s+gxbS44l/V6bIpKf4NN8taUBGGniQzmE0UUog0eXLMbDyF3bP2J18CIU1G5UqkkkL 8A4u5Rxn0k+uftuwptkENCpSUZJiz6wBHnYAi40kd6S/HXK2WZt2bD55uMmF2hcn7GAK TNF4AHdDh/XTaK444VwLV8x875rtoCd+sWdSIiJQDvpK7AEeA9uHJ1eTIhyMTxyzfXjR OE+X8NEPxjAuci3OVlj3JX6ubemFCzzMSt7ozSA0tfx7o93UNWfNpZcBXo2I10bkvwZL 1ubqwIL6NXXiXOI+7Qqv3ju2+px8zLt2wcaxOVzugL+lzJ87S9fdPsCl4w9Xe/43L6TB rikQ== 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=sRz0wk6e3pqbhorA4MDxMlMCBjR+5U5Qg85pQF4wUEA=; b=xxdNCuKTG3XDSsbsQCtn55NCG6kAp4Cs/9GazVTgOJ0ZIwlurQpa+bJdBRzSaSkCxo TN+1Lwye/y6CZ4l8xryraoxpsYBOzW+IH1N7XF1mu5Cig6JBZEWLdO0GxkSFUfllYI7W QtohHJUBrjYgZ0Y1mZxABwxU7h4wgzuPAcWgjNnbRx15gN/43LY32QWSokS6fKEZYL2V nOq1APCA9aLQTN/pMSoM02od4yYzhjOT0Wiu/bvWi137XsTJqoAXrwwt2qysICpqetgj AUyHctQ/GV3CGkETlYHD1omTOfile6C6H5YhhTUsxnPuK8TpM3zuazurtuJ1DbpOfz2g 3Uog== 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 22-v6si1522492pfl.220.2018.09.27.02.11.14; Thu, 27 Sep 2018 02:11:29 -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 S1728236AbeI0P01 (ORCPT + 99 others); Thu, 27 Sep 2018 11:26:27 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:55030 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727020AbeI0P01 (ORCPT ); Thu, 27 Sep 2018 11:26:27 -0400 Received: from localhost (ip-213-127-77-73.ip.prioritytelecom.net [213.127.77.73]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 15C2310A4; Thu, 27 Sep 2018 09:09:11 +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 30/88] ALSA: bebob: fix memory leak for M-Audio FW1814 and ProjectMix I/O at error path Date: Thu, 27 Sep 2018 11:03:11 +0200 Message-Id: <20180927090304.224730028@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 b1fbebd4164b3d170ad916dcd692cf843c9c065d upstream. After allocating model-dependent data for M-Audio FW1814 and ProjectMix I/O, ALSA bebob driver has memory leak at error path. This commit releases the allocated data at the error path. Fixes: 04a2c73c97eb('ALSA: bebob: 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/bebob/bebob.c | 2 ++ sound/firewire/bebob/bebob_maudio.c | 4 ---- 2 files changed, 2 insertions(+), 4 deletions(-) --- a/sound/firewire/bebob/bebob.c +++ b/sound/firewire/bebob/bebob.c @@ -263,6 +263,8 @@ do_registration(struct work_struct *work error: mutex_unlock(&devices_mutex); snd_bebob_stream_destroy_duplex(bebob); + kfree(bebob->maudio_special_quirk); + bebob->maudio_special_quirk = NULL; snd_card_free(bebob->card); dev_info(&bebob->unit->device, "Sound card registration failed: %d\n", err); --- a/sound/firewire/bebob/bebob_maudio.c +++ b/sound/firewire/bebob/bebob_maudio.c @@ -290,10 +290,6 @@ snd_bebob_maudio_special_discover(struct bebob->midi_output_ports = 2; } end: - if (err < 0) { - kfree(params); - bebob->maudio_special_quirk = NULL; - } mutex_unlock(&bebob->mutex); return err; }