Message ID | 1a0885c424bb21172702d254655882b59ef6477a.1702510018.git.soyer@irl.hu |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:3b04:b0:fb:cd0c:d3e with SMTP id c4csp8161052dys; Wed, 13 Dec 2023 15:28:39 -0800 (PST) X-Google-Smtp-Source: AGHT+IHMnf69rd1Zw+PuBveuEbMhbw4UaTQL/5C/wqDd/5ZskriLsQC+2v2s1FrEggPPdjG/2zLM X-Received: by 2002:a05:6358:7e8d:b0:170:6d55:e82e with SMTP id o13-20020a0563587e8d00b001706d55e82emr12092366rwn.2.1702510119697; Wed, 13 Dec 2023 15:28:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702510119; cv=none; d=google.com; s=arc-20160816; b=lZ3Yn4D62QW9y0Jp6U47uskELEj2chpqAmvTkpX1Nx/n899GHOW8wCkI8SjXKMhMK3 2GqIvvKoCpuo5gAG0hbhugXO2brWhcjsRJRTgmnEyH3rJSv+mvyjWmxAtTT2WbVjAF0Y mxHrndaBq9bzoKjdjz7C/RwxehkutxLOfEfLBJkDyikOxqdem9ZM8dMU9ynVamvb4s9f 8Y6JZWrk5n2H9Ip0NjwB0rX0huECd5DcQCANw+BBQU0ErzDRTxznNZx8vGXc9yEeUIqO 18d7MCQJWuvcIVSLz9B/iie3a1o5QG1lFyvVUybv5QpX1glFC+bx8t6Pxq4r11cJL+Mb 5Q0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=qnwwAaaxpgdtL1otOL2LyKPTutWXrYLlG7vpuaRw4CU=; fh=AtUyipZqf9Wt3VmKECtwTscIVbxtj0bqEzvKFfEmcRc=; b=xJDMDyNCF7SeBAprBLcsvF2HOLZDKR8miA5sRMoMm7uEisFT2SsbeN75nM5XMWQ/zO pd3H612/K+Ys12oO8gxAo6eDF098+oG1x7Koe4/1d6r7ccvLc2Ik1EfXFrO/4BKYnfeC f/3IESVy7D6N90F9/HadBax24xAYql7Owq3J7jKffM/f3yFUe/zLLctN+RYeJtWSbL+2 9hjQL0uK8ICatBsr4avaQQ8zQ4zIb/zLrElIhkp06NT64XkhWmYtOMrp8GEm+qxNTPS7 wdDUPeSsOkPPvf1fF3CLoPbsiQ0fFBIqk/ovQv9c2S0kWrbVExcyTpirMBIeinjSPziM WDng== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=irl.hu Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id ml11-20020a17090b360b00b0028659a5d68esi10340380pjb.115.2023.12.13.15.28.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 15:28:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=irl.hu Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 2162C8028BA6; Wed, 13 Dec 2023 15:28:35 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229698AbjLMX20 (ORCPT <rfc822;dexuan.linux@gmail.com> + 99 others); Wed, 13 Dec 2023 18:28:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34512 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230050AbjLMX2Z (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 13 Dec 2023 18:28:25 -0500 Received: from irl.hu (irl.hu [95.85.9.111]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 78E36A3; Wed, 13 Dec 2023 15:28:31 -0800 (PST) Received: from fedori.lan (51b690cd.dsl.pool.telekom.hu [::ffff:81.182.144.205]) (AUTH: CRAM-MD5 soyer@irl.hu, ) by irl.hu with ESMTPSA id 0000000000070634.00000000657A3E1D.0012846C; Thu, 14 Dec 2023 00:28:29 +0100 From: Gergo Koteles <soyer@irl.hu> To: Shenghao Ding <shenghao-ding@ti.com>, Kevin Lu <kevin-lu@ti.com>, Baojun Xu <baojun.xu@ti.com>, Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com> Cc: linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, Gergo Koteles <soyer@irl.hu>, stable@vger.kernel.org Subject: [PATCH v2] ALSA: hda/tas2781: call cleanup functions only once Date: Thu, 14 Dec 2023 00:28:16 +0100 Message-ID: <1a0885c424bb21172702d254655882b59ef6477a.1702510018.git.soyer@irl.hu> X-Mailer: git-send-email 2.43.0 Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Mime-Autoconverted: from 8bit to 7bit by courier 1.0 X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Wed, 13 Dec 2023 15:28:35 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785210980110577547 X-GMAIL-MSGID: 1785211251391014508 |
Series |
[v2] ALSA: hda/tas2781: call cleanup functions only once
|
|
Commit Message
Gergo Koteles
Dec. 13, 2023, 11:28 p.m. UTC
If the module can load the RCA but not the firmware binary, it will call
the cleanup functions. Then unloading the module causes general
protection fault due to double free.
Do not call the cleanup functions in tasdev_fw_ready.
general protection fault, probably for non-canonical address
0x6f2b8a2bff4c8fec: 0000 [#1] PREEMPT SMP NOPTI
Call Trace:
<TASK>
? die_addr+0x36/0x90
? exc_general_protection+0x1c5/0x430
? asm_exc_general_protection+0x26/0x30
? tasdevice_config_info_remove+0x6d/0xd0 [snd_soc_tas2781_fmwlib]
tas2781_hda_unbind+0xaa/0x100 [snd_hda_scodec_tas2781_i2c]
component_unbind+0x2e/0x50
component_unbind_all+0x92/0xa0
component_del+0xa8/0x140
tas2781_hda_remove.isra.0+0x32/0x60 [snd_hda_scodec_tas2781_i2c]
i2c_device_remove+0x26/0xb0
Fixes: 5be27f1e3ec9 ("ALSA: hda/tas2781: Add tas2781 HDA driver")
CC: stable@vger.kernel.org
Signed-off-by: Gergo Koteles <soyer@irl.hu>
---
sound/pci/hda/tas2781_hda_i2c.c | 5 -----
1 file changed, 5 deletions(-)
base-commit: ffc253263a1375a65fa6c9f62a893e9767fbebfa
Comments
On Thu, 14 Dec 2023 00:28:16 +0100, Gergo Koteles wrote: > > If the module can load the RCA but not the firmware binary, it will call > the cleanup functions. Then unloading the module causes general > protection fault due to double free. > > Do not call the cleanup functions in tasdev_fw_ready. > > general protection fault, probably for non-canonical address > 0x6f2b8a2bff4c8fec: 0000 [#1] PREEMPT SMP NOPTI > Call Trace: > <TASK> > ? die_addr+0x36/0x90 > ? exc_general_protection+0x1c5/0x430 > ? asm_exc_general_protection+0x26/0x30 > ? tasdevice_config_info_remove+0x6d/0xd0 [snd_soc_tas2781_fmwlib] > tas2781_hda_unbind+0xaa/0x100 [snd_hda_scodec_tas2781_i2c] > component_unbind+0x2e/0x50 > component_unbind_all+0x92/0xa0 > component_del+0xa8/0x140 > tas2781_hda_remove.isra.0+0x32/0x60 [snd_hda_scodec_tas2781_i2c] > i2c_device_remove+0x26/0xb0 > > Fixes: 5be27f1e3ec9 ("ALSA: hda/tas2781: Add tas2781 HDA driver") > CC: stable@vger.kernel.org > Signed-off-by: Gergo Koteles <soyer@irl.hu> Thanks, applied. Takashi
diff --git a/sound/pci/hda/tas2781_hda_i2c.c b/sound/pci/hda/tas2781_hda_i2c.c index fb802802939e..c6b292606dfa 100644 --- a/sound/pci/hda/tas2781_hda_i2c.c +++ b/sound/pci/hda/tas2781_hda_i2c.c @@ -550,11 +550,6 @@ static void tasdev_fw_ready(const struct firmware *fmw, void *context) tas2781_save_calibration(tas_priv); out: - if (tas_priv->fw_state == TASDEVICE_DSP_FW_FAIL) { - /*If DSP FW fail, kcontrol won't be created */ - tasdevice_config_info_remove(tas_priv); - tasdevice_dsp_remove(tas_priv); - } mutex_unlock(&tas_priv->codec_lock); if (fmw) release_firmware(fmw);