From patchwork Thu Jul 7 12:56:59 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: 12909554 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 2DB08C43334 for ; Thu, 7 Jul 2022 12:58:38 +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 669D31620; Thu, 7 Jul 2022 14:57:46 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 669D31620 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1657198716; bh=48xYBzIKX0PEgKorZ5dr85JNDLgv4rXOCMdCy1UhRyk=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=DVAXmwk67nTdJUbi20IoQehrL0TuT9NeBSfwTcfgzyULcnP8fHhLrSj3x7omy9VAP ze0PSugoEQMhUmvwtDGP88U5SxPUHxmfDUwU3F5ktwctrD74xUqZSOLiF6xy+Wb24Z t4EH6csWFTZGqHKAIV2qeLlbeCXnujiS9BUjMjgk= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 7835DF8053B; Thu, 7 Jul 2022 14:56:51 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id B9BD9F80537; Thu, 7 Jul 2022 14:56:49 +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 5F35AF804FB for ; Thu, 7 Jul 2022 14:56:44 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 5F35AF804FB Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="R0Pfb6n+" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1657198605; x=1688734605; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=48xYBzIKX0PEgKorZ5dr85JNDLgv4rXOCMdCy1UhRyk=; b=R0Pfb6n+q3aaYowORdIxGxnFZ1CggPHPUsVhfoSgs2zyWXZKXbnKExyB lJqSWTREpr8ZCFTvFphys0/hWp+mqpGvmGo4u5YM4eFcoHs8xjvKUbI2K gTWByOBYIMmirPcxNOa5li3uHUMh4RUqrJ5vuJY0aAu56t9F5R5KBglgY cHb8FJ3Y4XbK7JtvO0rA4U3J+xnXQtiteQV0dgUENbOTlitYHh8YfKIGq pKtJSYp25RLyM5L2onzY4CXi4+bgaKV9dMXO65lSQdpw0vEp25PGRbdcN C1Kuo3Bl7atVCiDql/IwWJwJ1C6W/vtzmY3VBxeScWDBiWChRzRaSyeJT w==; X-IronPort-AV: E=McAfee;i="6400,9594,10400"; a="272810622" X-IronPort-AV: E=Sophos;i="5.92,252,1650956400"; d="scan'208";a="272810622" 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:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,252,1650956400"; d="scan'208";a="620781748" Received: from dev2 (HELO DEV2.igk.intel.com) ([10.237.148.94]) by orsmga008.jf.intel.com with ESMTP; 07 Jul 2022 05:56:42 -0700 From: =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= To: Oder Chiou , Mark Brown Subject: [PATCH v2 3/5] ASoC: codecs: rt286: Set component to NULL on remove Date: Thu, 7 Jul 2022 14:56:59 +0200 Message-Id: <20220707125701.3518263-4-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/rt286.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sound/soc/codecs/rt286.c b/sound/soc/codecs/rt286.c index b2b0b2b1e4d0..c4f7c4c2d793 100644 --- a/sound/soc/codecs/rt286.c +++ b/sound/soc/codecs/rt286.c @@ -960,6 +960,7 @@ static void rt286_remove(struct snd_soc_component *component) struct rt286_priv *rt286 = snd_soc_component_get_drvdata(component); cancel_delayed_work_sync(&rt286->jack_detect_work); + rt286->component = NULL; } #ifdef CONFIG_PM