Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp1328698rdb; Wed, 6 Dec 2023 16:00:13 -0800 (PST) X-Google-Smtp-Source: AGHT+IH6kGsjSJwVYgjB4RmfcNQG4CSe/65nAD79S0xzaE9/Vb5+MeeJSLpXjAjZsBEkKPyBaTkX X-Received: by 2002:a05:6a00:4188:b0:6ce:2731:e863 with SMTP id ca8-20020a056a00418800b006ce2731e863mr2009468pfb.42.1701907212647; Wed, 06 Dec 2023 16:00:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701907212; cv=none; d=google.com; s=arc-20160816; b=GVGcXmJHLvFTe3OtC4JjuTHX7Q3xhZBbvRXMG15/j6v9UeTS1viqmKT2/eUzxsWONw i4DC8Wz6p1AHdmoSupgf+SmjmkIuntNJWPEkpZVdMiuj3IjtrmB2LDhjMHuJJWKX39jq 0YqkDyQIO4UdhpFyiBVnGR/7RbUVUUm5kj/F2LFEEtOphFd4bbzwxAlLHAaFpvGeScFZ LOaJ/pJbhbJAZ/GRPH85XeVzT3b7KfjfNp/eKpF+fr/1nnCwmF1LsXHy9du+DTTjJuNQ ijw35pt397uUo65+Sw8hp2R8JktYwkeix7hTVp050iaNAa88GpUPNuQHxYxZChXuSVya lyRg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=skOqsMq2SHh5TWXiR0riNg05ppH1I0l2+xejiEawCy0=; fh=zySoyVfK/7ExaDz2MWyww8poQ40q3tZak5TTvfb/Ovc=; b=uOfKcw5CThuAp/eiHcxphzW5jxnB4PRyTMvkJVmxCHmgav7dVdZbDtlSfQkwtyALIN AFGZY2xc4Rf8KpdmSSqVpUWhyub44E3qQakGS576PmYWcfXGFyR/atR5B+FSW2o5RkHO nocaVmRoWQTPGQ4fuZIKO0cnl7SAgPQho7VW82pBZyFGL3uwnyvuyfoy0fO6RuK5l/RZ Ok955tnExwQXayshu+qE9mVZMMA1/rL+VYsFBft+7jLqfqoic7a/AbQvXnVQM4xKXNNB V+jbcA+1/PBMsePPp8Slt8lqtU2mI7EhF4rAo/PGCFxpE+3/Y9I1/XxqxlC8wrVIxzNu 2Pkg== 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:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id bf15-20020a656d0f000000b005c685a2d34esi102492pgb.321.2023.12.06.16.00.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Dec 2023 16:00:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (Postfix) with ESMTP id 87EFD80D44C7; Wed, 6 Dec 2023 16:00:10 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231218AbjLGAAA (ORCPT + 99 others); Wed, 6 Dec 2023 19:00:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50686 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229707AbjLFX77 (ORCPT ); Wed, 6 Dec 2023 18:59:59 -0500 Received: from irl.hu (irl.hu [95.85.9.111]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3648A19E for ; Wed, 6 Dec 2023 16:00:05 -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 00000000000716DF.0000000065710B02.00119017; Thu, 07 Dec 2023 01:00:02 +0100 From: Gergo Koteles To: Shenghao Ding , Kevin Lu , Baojun Xu , Jaroslav Kysela , Takashi Iwai , Liam Girdwood , Mark Brown Cc: linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, Gergo Koteles Subject: [PATCH 02/16] ALSA: hda/tas2781: leave hda_component in usable state Date: Thu, 7 Dec 2023 00:59:43 +0100 Message-ID: <1be369f5a007c9f77bce7a33748ef428152894d7.1701906455.git.soyer@irl.hu> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: 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=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Wed, 06 Dec 2023 16:00:10 -0800 (PST) Unloading then loading the module causes a panic. Set only previously modified fields to null. Signed-off-by: Gergo Koteles --- sound/pci/hda/tas2781_hda_i2c.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sound/pci/hda/tas2781_hda_i2c.c b/sound/pci/hda/tas2781_hda_i2c.c index fb802802939e..077a01521eef 100644 --- a/sound/pci/hda/tas2781_hda_i2c.c +++ b/sound/pci/hda/tas2781_hda_i2c.c @@ -613,8 +613,11 @@ static void tas2781_hda_unbind(struct device *dev, struct tasdevice_priv *tas_priv = dev_get_drvdata(dev); struct hda_component *comps = master_data; - if (comps[tas_priv->index].dev == dev) - memset(&comps[tas_priv->index], 0, sizeof(*comps)); + if (comps[tas_priv->index].dev == dev) { + comps[tas_priv->index].dev = NULL; + strscpy(comps->name, "", sizeof(comps->name)); + comps[tas_priv->index].playback_hook = NULL; + } tasdevice_config_info_remove(tas_priv); tasdevice_dsp_remove(tas_priv); -- 2.43.0