From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AE31F3D1CD7 for ; Mon, 6 Jul 2026 06:49:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783320569; cv=none; b=R4UjxvGxsSd/L7eU3BjTUmEtuRUS8l6qjQNhMs47P4zhn98k+OgESTo9oG0vVX8bGNSbsEBGXmzb5w7+q5B0PP0zINvIS5KbFdHSMis4cCd4RUyNLdKB7zkUveJie2nUiUZ/Zrm/6fogPbHwzYBT/pdu21UrZBa9LrbCJDjguIc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783320569; c=relaxed/simple; bh=KEwPceGL8WsYDdoh10fe6ChCQgZTbSaz6V1VHNi9TDY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=BhrL4kTCdiMksOjAajtmQsJ+MXIl46ykiHBXa7EVLlXUQMa2TQT/hl0UOF92dxinVu++WKGpz6JfFqqG8jSj8RBcykk9XnHwbDL8R9MgRfi6bPeEL4DiKv0kvA/wCgLrfwpyiKmHUNR4M5z0UAX/wRWyA92KFacJwqXBAtfEn+8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=OPKMf3rI; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="OPKMf3rI" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0CA681F000E9; Mon, 6 Jul 2026 06:49:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1783320561; bh=4Rz8vQbxjTYMCMNaXDKFRzwZXnQx8TCV02hYjtoGEAQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=OPKMf3rIzvb9n4nH9+8VFh7Deqo4GGiGSAVMN2cvX/9msbzcd1WNheFVsQEVq3Ar1 gF9Xi6HMg0t00Dy5MK1m4s5b7ci41a/gi3ef+irij+Z4/kvytZ2Xc//PXh7NIGR1R9 Nw/8gZULEkK7zszFMMLqExMtXYQw8bplwlK5RwRQ= Date: Mon, 6 Jul 2026 08:48:05 +0200 From: Greg Kroah-Hartman To: Guangshuo Li Cc: Alexander Shishkin , Johan Hovold , linux-kernel@vger.kernel.org Subject: Re: [PATCH] intel_th: Fix MSC output device reference leak Message-ID: <2026070655-culprit-rake-f1d1@gregkh> References: <20260705144157.289303-1-lgs201920130244@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260705144157.289303-1-lgs201920130244@gmail.com> On Sun, Jul 05, 2026 at 10:41:57PM +0800, Guangshuo Li wrote: > intel_th_output_open() looks up the output device with > bus_find_device_by_devt(), which returns the device with a reference that > must be dropped after use. > > The reference is currently intended to be dropped from > intel_th_output_release(). However, a successful open replaces > file->f_op with the output driver's file operations before returning, so > close runs the output driver's release method rather than > intel_th_output_release(). > > For MSC outputs, close runs intel_th_msc_release(). That release path > only removes the per-file iterator and does not drop the device > reference taken by intel_th_output_open(), so every successful MSC open > leaks one device reference. > > Drop the device reference from intel_th_msc_release(), which is the > release path that is actually used for MSC output files. > > Fixes: 95fc36a234da ("intel_th: fix device leak on output open()") > Signed-off-by: Guangshuo Li > --- > drivers/hwtracing/intel_th/msu.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/hwtracing/intel_th/msu.c b/drivers/hwtracing/intel_th/msu.c > index a82cf74f39ad..84d99d7b1d20 100644 > --- a/drivers/hwtracing/intel_th/msu.c > +++ b/drivers/hwtracing/intel_th/msu.c > @@ -1490,8 +1490,10 @@ static int intel_th_msc_release(struct inode *inode, struct file *file) > { > struct msc_iter *iter = file->private_data; > struct msc *msc = iter->msc; > + struct intel_th_device *thdev = msc->thdev; > > msc_iter_remove(iter, msc); > + put_device(&thdev->dev); > > return 0; > } > -- > 2.43.0 > Hi, This is the friendly patch-bot of Greg Kroah-Hartman. You have sent him a patch that has triggered this response. He used to manually respond to these common problems, but in order to save his sanity (he kept writing the same thing over and over, yet to different people), I was created. Hopefully you will not take offence and will fix the problem in your patch and resubmit it so that it can be accepted into the Linux kernel tree. You are receiving this message because of the following common error(s) as indicated below: - You have marked a patch with a "Fixes:" tag for a commit that is in an older released kernel, yet you do not have a cc: stable line in the signed-off-by area at all, which means that the patch will not be applied to any older kernel releases. To properly fix this, please follow the documented rules in the Documentation/process/stable-kernel-rules.rst file for how to resolve this. If you wish to discuss this problem further, or you have questions about how to resolve this issue, please feel free to respond to this email and Greg will reply once he has dug out from the pending patches received from other developers. thanks, greg k-h's patch email bot