Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp255900ybd; Tue, 25 Jun 2019 20:51:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqyCx2ofaMGBoBxpwfRyCeqnTfWRjwNJoVoB02Ov8t1MCOIl9cYTAPzyRpO2Wh87agGONkY2 X-Received: by 2002:a63:6986:: with SMTP id e128mr667286pgc.220.1561521118845; Tue, 25 Jun 2019 20:51:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561521118; cv=none; d=google.com; s=arc-20160816; b=BKx9sJHutIqwMDs896spVQpNUdTHs/z/Jfyum6pblpwalf+4HbHOvIAwLjEw6tjOSc hv1twsb+BJ+J1Nmg4GOtHbLgw1YuLItf9MXBjrzOMm7nDx9wt91DP4W7Sr0oR4hYUrt7 osbTyQRuzHhrVICB/OxeVywa8ku9PLrQQSf9RISDRwP5LnR4m2FVP5OGYzpAgIVVctFi K29cnXIffEDPLmhRLOiLvEHI1zBVaG8AxMqQg8rrWLL9Q+EE0Ql0gn04EwDMSGkh9Se8 A50F8EvWaGYHZ/s/j8ih+2Vfvzk6L0TYUKDB4N4t5Cw78ASCPkWl3cCpaK5Z+Ld31V4a cVPQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=M3RAZNsU1vdMwxaNur+QgDdjiCyWtbQwKsUtgZDxooo=; b=fvaATrIzw/2JDb+j11rSDxN5oK9MTI83bV3DUXjHCPmzTOrfIIG0FksrjjraohcC+l t2AIm/+r+g3a5K5otVZi8j2HVEWBP/CWR99sGKz4veMoTuxE3do52DG69ctGdssOX9bX XkWfbzFTQxA0UqNuuv/wfwWLW6rEuX+/XXVC4hHV+LxrZt17f5dKW/bYSELpAOYaTQ1c GyVFWDGvKJbZKzl1biqth1kWlsWz1WpliKb61S2bSeTL39KM9Tz4j4ouWqqe2UXy+FKE 1xBzsjndPvWMzsNFReNuE9Mkm4n1lo13GR7ZhOb8uwReNd8CUios8xpo8uY7yf6DaNRj 0VBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=154DXg6i; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u12si15453246pfh.256.2019.06.25.20.51.43; Tue, 25 Jun 2019 20:51:58 -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; dkim=pass header.i=@kernel.org header.s=default header.b=154DXg6i; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726656AbfFZDmw (ORCPT + 99 others); Tue, 25 Jun 2019 23:42:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:53834 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727172AbfFZDmt (ORCPT ); Tue, 25 Jun 2019 23:42:49 -0400 Received: from sasha-vm.mshome.net (mobile-107-77-172-74.mobile.att.net [107.77.172.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 92213216F4; Wed, 26 Jun 2019 03:42:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1561520569; bh=8KgP9G391SzXZic0rr2SsYjcF9vMsNLj1iFKFLCunqA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=154DXg6iYNwkYDW9Zk9qPlNmCL5CxvUhMJASfjBEqJnGIvy/GBDU6tMXW7x7KheOs CGna1bo+DHwUdC0jE8P2tGL6d/HpfIWUPL/6rgaegCt85lfap9SrlDk1ncGIO4iFrX ITRE1Wnd0zyFW7FhqD4KxfNDsE1fDjm+W4KTTgZQ= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: =?UTF-8?q?Amadeusz=20S=C5=82awi=C5=84ski?= , Takashi Iwai , Pierre-Louis Bossart , Mark Brown , Sasha Levin Subject: [PATCH AUTOSEL 5.1 32/51] ALSA: hdac: fix memory release for SST and SOF drivers Date: Tue, 25 Jun 2019 23:40:48 -0400 Message-Id: <20190626034117.23247-32-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190626034117.23247-1-sashal@kernel.org> References: <20190626034117.23247-1-sashal@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Amadeusz Sławiński [ Upstream commit 6d647b736a6b1cbf2f8deab0e6a94c34a6ea9d60 ] During the integration of HDaudio support, we changed the way in which we get hdev in snd_hdac_ext_bus_device_init() to use one preallocated with devm_kzalloc(), however it still left kfree(hdev) in snd_hdac_ext_bus_device_exit(). It leads to oopses when trying to rmmod and modprobe. Fix it, by just removing kfree call. SOF also uses some of the snd_hdac_ functions for HDAudio support but allocated the memory with kzalloc. A matching fix is provided separately to align all users of the snd_hdac_ library. Fixes: 6298542fa33b ("ALSA: hdac: remove memory allocation from snd_hdac_ext_bus_device_init") Reviewed-by: Takashi Iwai Signed-off-by: Amadeusz Sławiński Signed-off-by: Pierre-Louis Bossart Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/hda/ext/hdac_ext_bus.c | 1 - 1 file changed, 1 deletion(-) diff --git a/sound/hda/ext/hdac_ext_bus.c b/sound/hda/ext/hdac_ext_bus.c index ec7715c6b0c0..c147ebe542da 100644 --- a/sound/hda/ext/hdac_ext_bus.c +++ b/sound/hda/ext/hdac_ext_bus.c @@ -172,7 +172,6 @@ EXPORT_SYMBOL_GPL(snd_hdac_ext_bus_device_init); void snd_hdac_ext_bus_device_exit(struct hdac_device *hdev) { snd_hdac_device_exit(hdev); - kfree(hdev); } EXPORT_SYMBOL_GPL(snd_hdac_ext_bus_device_exit); -- 2.20.1