Received: by 2002:a89:2c3:0:b0:1ed:23cc:44d1 with SMTP id d3csp1071486lqs; Wed, 6 Mar 2024 05:41:11 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXfsIYCfIo8jinjzF2xUiMVad0//FuvQbd55a9eQcT3K8b372rBWPdHrYBh9d+3LGSiGJNT1OOpXnv4lg0RcpqWhPENBHwgMpnv1MgIOw== X-Google-Smtp-Source: AGHT+IF+Wia/N0Yzxmx+QZudeBAuASi8gIkIwprZakwwoCbvYmG4f9ECH6pmjqy8YnznV2COeAHp X-Received: by 2002:a05:6402:1249:b0:567:4441:89ad with SMTP id l9-20020a056402124900b00567444189admr6567005edw.15.1709732471276; Wed, 06 Mar 2024 05:41:11 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709732471; cv=pass; d=google.com; s=arc-20160816; b=zGrzwb6QjcklpthwiObv1mb+kbkOnv/kSRN8+s4zTSyk4V5inJp+2CvYHVTx56xCJ3 3QOQ9uFsF5TGqD68eAiq/ppBKYLNsTkB5eDVAukwaJwubyXdx2VtKiuvLVEC8nQKS2Jg wFStn+I6blnRoZrPbljEk5T1oaO4IBYzil99WcB2W+kbWu7k/sWYgX6CXzkeuZ/Z17ne U8qfbQNLI63WYWV6yHkFIxKWHOHcsRFPa0VIT9Ty4hF2d2h4ho+nvlouebG8qbsQqjFO G1FrwNMLsVAo0NhFHZ8VuE82/01fgXJmTk7f0UgtUleXyEpP0JN6cJGD6FJWgoPlpN5/ k1HQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:mail-followup-to :message-id:subject:cc:to:from:date:feedback-id:dkim-signature :dkim-signature; bh=8eGGmM1KR7AcuGh7NIqABGQLQZZwfZwqFbPI2nbC2o0=; fh=7HOJydSLraokbIk0LPXicB3CXxKASUdKc00SjDXWjIQ=; b=VZBRMLwAbCWk72CTJddo2l6Qi8SEa3MC1ae/IJg9k+0qEI9BnMSaJVkv4xJpAhd0pc ujI5OXiBwqGjODNNKwyEKgsjUvq2iFmT+R2AO2pYaLewOCNSx60jiDAtm+vKq9UrB46E MTccQZ3qFaSd3xP3VOvgTw9pzC/uzS5HQQMyXRC9coRTNVQqc19Rmt+AO2ZFRH5ePVb9 fFeThI/IICQpLWYZRgHtSDRJkVQZckZc1jYAcEIHQZwreNyai5T4KAMMXC1rKOl06Zaa LnOwF47WvCyAxZOB4M0UaJiI9O0Vj3CjY6NzVBMiaXIOjzB2gjuo2apZXsqdhgDbKDI4 EH2Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@sakamocchi.jp header.s=fm1 header.b=pQqyyCql; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=WUeFs0LG; arc=pass (i=1 spf=pass spfdomain=sakamocchi.jp dkim=pass dkdomain=sakamocchi.jp dkim=pass dkdomain=messagingengine.com dmarc=pass fromdomain=sakamocchi.jp); spf=pass (google.com: domain of linux-kernel+bounces-93992-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-93992-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sakamocchi.jp Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id v10-20020a50a44a000000b0056649094f4esi6188363edb.644.2024.03.06.05.41.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Mar 2024 05:41:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-93992-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@sakamocchi.jp header.s=fm1 header.b=pQqyyCql; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=WUeFs0LG; arc=pass (i=1 spf=pass spfdomain=sakamocchi.jp dkim=pass dkdomain=sakamocchi.jp dkim=pass dkdomain=messagingengine.com dmarc=pass fromdomain=sakamocchi.jp); spf=pass (google.com: domain of linux-kernel+bounces-93992-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-93992-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sakamocchi.jp Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 047721F275CC for ; Wed, 6 Mar 2024 13:41:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 766141E519; Wed, 6 Mar 2024 13:41:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sakamocchi.jp header.i=@sakamocchi.jp header.b="pQqyyCql"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="WUeFs0LG" Received: from wfout8-smtp.messagingengine.com (wfout8-smtp.messagingengine.com [64.147.123.151]) (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 83B3A131745 for ; Wed, 6 Mar 2024 13:41:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=64.147.123.151 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709732466; cv=none; b=vFR+1kuAwsIQxgzwtMkPwDaf49g1UM3IlzrZq/0f6ZxuvCRflnScmc7c1Jk1oeCer/vozQDxzmaQif3IEpf7cnuK9zYw8T9v0w7mbqS2NhhLAZi4yD+bo3S9kZK7r1I9ZSA2J9GksZDG5WjSOsH5mhUIPAlmKQcFs5kRtODFQB0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709732466; c=relaxed/simple; bh=DqyuLe982M0gCzXNHkRNqdo/en/tcqMLSPM6bGJs+l8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=rq7/pYcz3aG5IVU8ulU//l6v5Yw3ltP36vbj5iOm5p872Kl9l6FIHXDhnsLMokpVG+hT6JUGyCj7NauMqR/1N5GXPLg/oBoeGj0sXoDZ2Vd0AmZoTINS0mSYA9V6Ht0QPCTYAkkzNo4xjFQRYrVEdpVMbQCmf2qU5WRTGzdqo6k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sakamocchi.jp; spf=pass smtp.mailfrom=sakamocchi.jp; dkim=pass (2048-bit key) header.d=sakamocchi.jp header.i=@sakamocchi.jp header.b=pQqyyCql; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=WUeFs0LG; arc=none smtp.client-ip=64.147.123.151 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sakamocchi.jp Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sakamocchi.jp Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailfout.west.internal (Postfix) with ESMTP id 0CC0E1C000B5; Wed, 6 Mar 2024 08:41:01 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Wed, 06 Mar 2024 08:41:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sakamocchi.jp; h=cc:cc:content-type:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm1; t=1709732461; x= 1709818861; bh=8eGGmM1KR7AcuGh7NIqABGQLQZZwfZwqFbPI2nbC2o0=; b=p QqyyCqlax0VekC+Sgn3UonHyKUxzjko/W+1I49gCNsNSOSpFGuGt+jX6m5ghUE8n eQvLK3o2Z529+WIfSAE4pO9+YabIUhYNRZIBKm/4BVvQkQCFEUMCPvl/S1nyvZ3h Ud95cHEkOVbPKBvvHNm3tFgd7jAKjZ2L4ngTRUkERfHwmWnvZHBtimAtKXTvLszT xSpLFosx9nW5MqDTVSm6oY6mD0OG6Fv2eiQ313czSC47S/75KnjXa08FhLI0EGZ2 9n5JiZ38jyvo3Jt0QoRxds4SWlleXfaUN5a72h/SQaKQMOXsWfhjE1F5EvsmJ5ID +A/ZuM4zifYaDpbUhGGdg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1709732461; x=1709818861; bh=8eGGmM1KR7AcuGh7NIqABGQLQZZw fZwqFbPI2nbC2o0=; b=WUeFs0LGk+h67KdusPFYnAPyCP/I7PhiyPqAPsH+uhPo kXkK/66ApjN8jCvAGWG8ioQlOkQM1z3bei0M6Pb/SgzpKThnZLZzZZdT502pzgmw fHMMwb/KKUo8t7dCMFTe+2CfaLUCLN7pevgsboQlZqJu5R+KV/Qlsz8QmuV0coXq 0cdGUpd8AOsI2EaRQa1UtnwggfAWtDMBvfmPdz0LiS/RYr4efYHaXKtCd34sZ0kh v9uDY6SiIFc0Ml0cdxCmWzSddsnSOtfOVZnsQmDyANIt0/vtZwkay+ePV4xpLw75 e69DvuS9T010AV4lIR5HPmOnGhiq51j5hjQN+cSDaw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledriedugdehudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvvefukfhfgggtuggjsehttdertddttddvnecuhfhrohhmpefvrghkrghs hhhiucfurghkrghmohhtohcuoehoqdhtrghkrghshhhisehsrghkrghmohgttghhihdrjh hpqeenucggtffrrghtthgvrhhnpeehhffhteetgfekvdeiueffveevueeftdelhfejieei tedvleeftdfgfeeuudekueenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmh grihhlfhhrohhmpehoqdhtrghkrghshhhisehsrghkrghmohgttghhihdrjhhp X-ME-Proxy: Feedback-ID: ie8e14432:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 6 Mar 2024 08:41:00 -0500 (EST) Date: Wed, 6 Mar 2024 22:40:56 +0900 From: Takashi Sakamoto To: Edmund Raile Cc: linux1394-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] firewire: ohci: prevent leak of left-over IRQ on unbind Message-ID: <20240306134056.GA124318@workstation.local> Mail-Followup-To: Edmund Raile , linux1394-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org References: <20240229101236.8074-1-edmund.raile@proton.me> <20240229144723.13047-2-edmund.raile@proton.me> 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: <20240229144723.13047-2-edmund.raile@proton.me> Hi, On Thu, Feb 29, 2024 at 02:47:59PM +0000, Edmund Raile wrote: > > Commit 5a95f1ded28691e6 ("firewire: ohci: use devres for requested IRQ") > also removed the call to free_irq() in pci_remove(), leading to a > leftover irq of devm_request_irq() at pci_disable_msi() in pci_remove() > when unbinding the driver from the device > > remove_proc_entry: removing non-empty directory 'irq/136', leaking at > least 'firewire_ohci' > Call Trace: > ? remove_proc_entry+0x19c/0x1c0 > ? __warn+0x81/0x130 > ? remove_proc_entry+0x19c/0x1c0 > ? report_bug+0x171/0x1a0 > ? console_unlock+0x78/0x120 > ? handle_bug+0x3c/0x80 > ? exc_invalid_op+0x17/0x70 > ? asm_exc_invalid_op+0x1a/0x20 > ? remove_proc_entry+0x19c/0x1c0 > unregister_irq_proc+0xf4/0x120 > free_desc+0x3d/0xe0 > ? kfree+0x29f/0x2f0 > irq_free_descs+0x47/0x70 > msi_domain_free_locked.part.0+0x19d/0x1d0 > msi_domain_free_irqs_all_locked+0x81/0xc0 > pci_free_msi_irqs+0x12/0x40 > pci_disable_msi+0x4c/0x60 > pci_remove+0x9d/0xc0 [firewire_ohci > 01b483699bebf9cb07a3d69df0aa2bee71db1b26] > pci_device_remove+0x37/0xa0 > device_release_driver_internal+0x19f/0x200 > unbind_store+0xa1/0xb0 > > remove irq with devm_free_irq() before pci_disable_msi() > also remove it in fail_msi: of pci_probe() as this would lead to > an identical leak > > Fixes: 5a95f1ded28691e6 ("firewire: ohci: use devres for requested IRQ") > > Signed-off-by: Edmund Raile Applied to for-linus branch. I'll send it for v6.8-final. I think the pairs of 'pci_alloc_irq_vectors()' and 'request_irq()', 'free_irq()' and 'pci_free_irq_vectors()' would be fine here, but the replacement of legacy API is not welcome in the last week of kernel development, so I postpone the work to the future. Thanks Takashi Sakamoto