From patchwork Thu Jul 7 12:57:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= X-Patchwork-Id: 588137 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D9097C43334 for ; Thu, 7 Jul 2022 12:58:52 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 2A031167E; Thu, 7 Jul 2022 14:58:01 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 2A031167E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1657198731; bh=pHK4ONpmi/hffbIZWIVp+R0sZZyRbxatAn5qwlGW0G8=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=DdhFWco/Tq6bAcau7D0U14A2xf+NtQKiqTnRAnUdloQOPwRBINNUsC30LCmOqdvAS t+8779fQMKPXInMF/lVgH9iHic55iU28a0na7cPVqnwpbj9NSXaPP49gaCIs0GoYMw hhlDBUleZ0yqhXc69Wa2wZYqlHQF7bwJMIc01jfQ= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 01A93F8053A; Thu, 7 Jul 2022 14:56:55 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 63D26F80544; Thu, 7 Jul 2022 14:56:53 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 5DA9EF8053A for ; Thu, 7 Jul 2022 14:56:50 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 5DA9EF8053A Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="gNeFgtoj" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1657198611; x=1688734611; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=pHK4ONpmi/hffbIZWIVp+R0sZZyRbxatAn5qwlGW0G8=; b=gNeFgtoj7lJpRRSBgKHeYGSclmCTmpPX8F389hgrnlG8fqRO0YmMS3yF xG6AFLzavcMG+qIq/l+mki7Q30FtRUksvmmZ5LHzgMc/qPfGDfiUSZY+U YVng5RlBXWERT+AnJwPicWvm7JPmmqo/6KP+HhJn/SU5PMJxokEVOjB6P pMon1XbNVoduwiCfYT0xiDgBU5hWzpWE5UIMr2p3gxHl55mfAT8b8kuvd fw7FVp1nvG6Eh/hGWMdmoPr/oIjYN4aXKNaITXMTlzaUovUDF2ytYUIjz 9tOiVTiw6QD20+tC60WtGsD5GKAZo2oviK9ReoGFqupsxXziExg71FA/Z A==; X-IronPort-AV: E=McAfee;i="6400,9594,10400"; a="272810635" X-IronPort-AV: E=Sophos;i="5.92,252,1650956400"; d="scan'208";a="272810635" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jul 2022 05:56:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,252,1650956400"; d="scan'208";a="620781781" Received: from dev2 (HELO DEV2.igk.intel.com) ([10.237.148.94]) by orsmga008.jf.intel.com with ESMTP; 07 Jul 2022 05:56:46 -0700 From: =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= To: Oder Chiou , Mark Brown Subject: [PATCH v2 5/5] ASoC: codecs: rt274: Set component to NULL on remove Date: Thu, 7 Jul 2022 14:57:01 +0200 Message-Id: <20220707125701.3518263-6-amadeuszx.slawinski@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220707125701.3518263-1-amadeuszx.slawinski@linux.intel.com> References: <20220707125701.3518263-1-amadeuszx.slawinski@linux.intel.com> MIME-Version: 1.0 Cc: Pierre-Louis Bossart , Cezary Rojewski , alsa-devel@alsa-project.org, Takashi Iwai , Liam Girdwood , =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Make sure that component is set to proper value, otherwise we may dereference freed component in interrupt. Signed-off-by: Amadeusz Sławiński Reviewed-by: Cezary Rojewski --- sound/soc/codecs/rt274.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sound/soc/codecs/rt274.c b/sound/soc/codecs/rt274.c index 6b208f9eb503..f2c50b11e4d0 100644 --- a/sound/soc/codecs/rt274.c +++ b/sound/soc/codecs/rt274.c @@ -993,6 +993,7 @@ static void rt274_remove(struct snd_soc_component *component) struct rt274_priv *rt274 = snd_soc_component_get_drvdata(component); cancel_delayed_work_sync(&rt274->jack_detect_work); + rt274->component = NULL; } #ifdef CONFIG_PM