Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1966886imm; Thu, 24 May 2018 03:44:30 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpyXwiI534kLBGxEN0tv4knNj1Z4rG7eknGV9HiVDoKI0TSpoM+KpchG62i2avfezxxxqIO X-Received: by 2002:a65:66d7:: with SMTP id c23-v6mr5429464pgw.76.1527158670653; Thu, 24 May 2018 03:44:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527158670; cv=none; d=google.com; s=arc-20160816; b=i41X3GMR7ck0o/be/P2GCUNJJYUkDVo1DNNs03pjx6qsiLIzBTcGJdG/pCDuxG7Jva SRoAQ9BSb9Q5fGF9WaVQl5IRzhd3mxRBDjJmxwLd+NbKdgxHsTmuGFkt1v4LnjK4vJfV wEEDv0wfdU/KCfX1+FugYiF0+mhAmytTY/vdshEOB1IiWzjch81aseCM7puEcRKDaFoI cY5F/1yttvIlBAwZ7R6glgz+rH9CgmtHTWMqNiKfivEFsxkkuBcom5rwY8mzUQ9sko29 Ly1qs0k6ItBVV+FmjiQDyQBCqrV0xoOK742jeQI7n5sp0Cqc0FFBbSe6G8Z7tVBjA9m/ K8sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=EGk5H1tj3Ux6W++MqmNOPHc8wdB1BJ4Qv/sUrjlNb+g=; b=U2mxLp0VXH7BuP0bvP+l1w25ARpl8jTMib3iL333mXoXCKB1XlHjQFWE+juxdIJ2ld 5RtWD/v+AtjqJeeHfPJAmnhUr9WEBNV58TU4cKN9jB4zOkdhv4Jlqp29uEluaeG9jxee hq87z6PeEm0wAnq0KAO04iyGuADxpoNIJfYXBdj88GgCOgOSufXY45XVEvd/ySiVd4JV f++ywPs6+9GB6QlQSINZJ4S77MrZENt61+jzeIGPRQ8/dg8VST8U6YlOIPmihTz41cE2 FFcxpFpYLn3SNqrrES5mBTMM8+2cJ6L7S5qEdgrv8+eLKUjHsV6NvF/6uoCg7k+C9oy/ Bmbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Pjbr7J4M; 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 c8-v6si21015718pfj.138.2018.05.24.03.44.16; Thu, 24 May 2018 03:44:30 -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=Pjbr7J4M; 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 S1032363AbeEXKnl (ORCPT + 99 others); Thu, 24 May 2018 06:43:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:38012 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030582AbeEXJ6N (ORCPT ); Thu, 24 May 2018 05:58:13 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B13C620870; Thu, 24 May 2018 09:58:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527155893; bh=JrjIRw80oBV0nr5xD3Un5hBypa7ztPFWaDvRWzCpjHg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Pjbr7J4M88Cgao+FYi9FnyMboCmL9zlPOE7kBNBKCtpiLreo3rfTwc3lgMUmwENHY RJ6eFb3F5Lkr04qGIFAIYK+2qLxP+/ifFXjwvms7khwl4GUt98PAZSAVvA/wGEaHix Ykq4HcELojUch9lKRyZ+SPS1Sbyq2XTIYKk3B8ys= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Peter Ujfalusi , Jyri Sarha , Mark Brown , Sasha Levin Subject: [PATCH 4.14 121/165] ASoC: hdmi-codec: Fix module unloading caused kernel crash Date: Thu, 24 May 2018 11:38:47 +0200 Message-Id: <20180524093626.899960701@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180524093621.979359379@linuxfoundation.org> References: <20180524093621.979359379@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Peter Ujfalusi [ Upstream commit 5e558f8afaec8957932b1dbe5aeff800f9fc6957 ] The hcp->chmap_info must not be freed up in the hdmi_codec_remove() function as it leads to kernel crash due ALSA core's pcm_chmap_ctl_private_free() is trying to free it up again when the card destroyed via snd_card_free. Commit cd6111b26280a ("ASoC: hdmi-codec: add channel mapping control") should not have added the kfree(hcp->chmap_info); to the hdmi_codec_remove function. Signed-off-by: Peter Ujfalusi Reviewed-by: Jyri Sarha Tested-by: Jyri Sarha Signed-off-by: Mark Brown Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- sound/soc/codecs/hdmi-codec.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) --- a/sound/soc/codecs/hdmi-codec.c +++ b/sound/soc/codecs/hdmi-codec.c @@ -801,12 +801,7 @@ static int hdmi_codec_probe(struct platf static int hdmi_codec_remove(struct platform_device *pdev) { - struct device *dev = &pdev->dev; - struct hdmi_codec_priv *hcp; - - hcp = dev_get_drvdata(dev); - kfree(hcp->chmap_info); - snd_soc_unregister_codec(dev); + snd_soc_unregister_codec(&pdev->dev); return 0; }