Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5650181rdb; Wed, 13 Dec 2023 15:28:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IHKxlzLPrf7HCj9h+miR6zX7FuKALKKENr3P29D98sWKGStmnqS3z9tmeW/Jaiadr+7n+QT X-Received: by 2002:a9d:6e91:0:b0:6d9:e2ef:d74c with SMTP id a17-20020a9d6e91000000b006d9e2efd74cmr8333331otr.47.1702510124819; Wed, 13 Dec 2023 15:28:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702510124; cv=none; d=google.com; s=arc-20160816; b=BWwLo74oT+RrYUmNHGWulDYZyHvsLPnupS3uK/CBcHcBwk6BV7yr4Lo+QVxwI/k/+D 82zslycahnxRTzctX30jt3gOpfaHS2h7B2agr8XCXQcelg/vEaU/zHw4XZubk63/Hj1n YCQskAVN3DgbMlL29/MMxDsEEafaIa0nLIloLlE1bXFIdxxiNnNRL1LmLishFzvF+1Fj sXPI1WXHCUvUmPbigkFHP/WKgfy9McPZFZiNZkh0/7Dmpkw0a+LZKZ1/dapHwxx67DYT +7bkc/tgOBYYIrSR667lPHsHYrtpiZwvQcdZCO0dvkef47bPql/vC3hGEha7MzO0GeCz 7VDw== 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 Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id 22-20020a630f56000000b005c65ed23b5bsi10216693pgp.149.2023.12.13.15.28.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 15:28:44 -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 4C2898028BA6; Wed, 13 Dec 2023 15:28:42 -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 + 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 ); 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 To: Shenghao Ding , Kevin Lu , Baojun Xu , Jaroslav Kysela , Takashi Iwai Cc: linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, Gergo Koteles , 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: 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:42 -0800 (PST) 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: ? 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 --- sound/pci/hda/tas2781_hda_i2c.c | 5 ----- 1 file changed, 5 deletions(-) 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); base-commit: ffc253263a1375a65fa6c9f62a893e9767fbebfa -- 2.43.0