From: Takashi Iwai Subject: Re: [PATCH] ASoC: hdac_hda: Fix unbalanced bus link refcount at probe error Date: Fri, 31 May 2019 17:43:03 +0200 Message-ID: References: <20190531143820.10142-1-tiwai@suse.de> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 2B50CF80757 for ; Fri, 31 May 2019 17:43:03 +0200 (CEST) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" To: Ranjani Sridharan Cc: alsa-devel@alsa-project.org, Mark Brown , Pierre-Louis Bossart List-Id: alsa-devel@alsa-project.org On Fri, 31 May 2019 17:31:10 +0200, Ranjani Sridharan wrote: > > On Fri, 2019-05-31 at 16:38 +0200, Takashi Iwai wrote: > > The error paths in hdac_hda_codec_probe() don't take care of the bus > > link refcount properly, which leave the refcount still high. > > This patch addresses them. > Hi Takashi, > > Thanks for this. But I looked into hdac_hdmi probe and we have a > similar problem there as well. Well, hdac_hdmi is a bit different. It seems managing the link at runtime PM. The link put is called at suspend, while get again at resume. What I'm not sure for now is whether it's safe to assume the device being suspended at the driver removal. If this is always correct, the link put should have been called already by runtime suspend at removal time. Still the code is a bit too fragile, yeah... Takashi