Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp4947345ioo; Tue, 31 May 2022 15:47:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzC6O16WAF8KqBFW+a0zOAusTzt2oyr7EbzPQCRKc0m3Ds+/+/FQFOJz3ru8ZfvX5wpA+Dp X-Received: by 2002:a17:90a:1588:b0:1e0:a45c:5c1 with SMTP id m8-20020a17090a158800b001e0a45c05c1mr31569052pja.65.1654037251557; Tue, 31 May 2022 15:47:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654037251; cv=none; d=google.com; s=arc-20160816; b=iBTQRfhLImfXKA4b21MRKSsc/li+ZfWzG5pdSKEyCIY7wYzCnOoqX0kg8o1PmrCaPl TD9HEwr5Fqsv3MwRvW0JIrdGxv5HO0Tkgyctw3nH2P26bhTdU0SUU7gpPa/uKQFd5Xd7 GlHOr/jDooXrTB9ISl96AF5i8FjXFh5Pet265KI59+67K+jjDdlph7IaFHdBB4YAW33E XMHVX5PBFhsAnd5Et8pXZTpj2PgElFmvihOK1YpAgQgC9WvIKdQH5WD8IbAR7cdjkfWH NNTQWkGlp2JtnsLoBZ1fJ3g6R8cZhMoMi1EExECPIpouybUDXPd+Dxr4GRXSUceg+6j9 5CgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=A03iX/xq3T3iEzNbyHznNRphB2kIaK/fzRXdR3ICH60=; b=GkmmR83W7yyQ5W6Z1KolTRf5gQ1LcIqHvd0PTCPA8UoK2ita3oHduanU4EPR+Pm976 kfp+PdfPhnoZCDipJ4cLvrhOvWmlYAEukoTgv/fp9IlM5kBjxEs2GQAYO3M63Dn/v+sa c6podRyYdf4tzq2RTepqulxPWkxUWNGoC5CDwpXsYdSqIlhK8fNoBj7I58M8JezNaVYr 7zpZhTwZzeW3hRdslxpohzxGzTPm1ssuNKj0q4iXKw74OcfimxZb4xCY97edMBTZWgdB MRKbRguPmM2+zaoluZwupfTaWJY7qeBgZrvnpnvGnJjlhWPicllrbQYTdMI2oMUK81Cv b4HQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=N9DhURA6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a65-20020a639044000000b003fa218e16c3si20988281pge.639.2022.05.31.15.47.19; Tue, 31 May 2022 15:47:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=N9DhURA6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242030AbiE3OvJ (ORCPT + 99 others); Mon, 30 May 2022 10:51:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44856 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242492AbiE3ObO (ORCPT ); Mon, 30 May 2022 10:31:14 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 65A76106552; Mon, 30 May 2022 06:53:04 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 47C32B80DBB; Mon, 30 May 2022 13:52:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 34895C36AE3; Mon, 30 May 2022 13:52:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1653918759; bh=Pc6AH3aNje77UUx9oth6RMHG9z01vE/DhvECuLUn6TE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=N9DhURA6rgch2TVmXdlhwhqZ5JgR71x7fCoK5qI4Shz9gUqGOt9ypcwlVFr9zcqr0 kO5eBco+cTnhNRztU0BRaAM7abtot5YOHJsKVom95NN90bQVzsMDHJcjGEhgYfZRfT XE3YuSA1cX2h0vbrk5BeSVDJvMU851BGe9ukGVXTBErVufzOgxsHXrNAnPmoqOUmU8 SwnUsHLyDrrMk3qpVEXwitmK33+kvbYHUVhITwqgwF3JRpXn/sBEbeAL8t1vVe0+HE R1v54+uGdvs+ZV1qHLzc7reowOALP/YeRssT84kHAQrAZlBcEGngSZh+qsZyD8bDt+ m1vn0vMqG/Rog== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Zheyu Ma , Hans Verkuil , Mauro Carvalho Chehab , Sasha Levin , linux-media@vger.kernel.org Subject: [PATCH AUTOSEL 4.9 10/24] media: cx25821: Fix the warning when removing the module Date: Mon, 30 May 2022 09:51:57 -0400 Message-Id: <20220530135211.1937674-10-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220530135211.1937674-1-sashal@kernel.org> References: <20220530135211.1937674-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Zheyu Ma [ Upstream commit 2203436a4d24302871617373a7eb21bc17e38762 ] When removing the module, we will get the following warning: [ 14.746697] remove_proc_entry: removing non-empty directory 'irq/21', leaking at least 'cx25821[1]' [ 14.747449] WARNING: CPU: 4 PID: 368 at fs/proc/generic.c:717 remove_proc_entry+0x389/0x3f0 [ 14.751611] RIP: 0010:remove_proc_entry+0x389/0x3f0 [ 14.759589] Call Trace: [ 14.759792] [ 14.759975] unregister_irq_proc+0x14c/0x170 [ 14.760340] irq_free_descs+0x94/0xe0 [ 14.760640] mp_unmap_irq+0xb6/0x100 [ 14.760937] acpi_unregister_gsi_ioapic+0x27/0x40 [ 14.761334] acpi_pci_irq_disable+0x1d3/0x320 [ 14.761688] pci_disable_device+0x1ad/0x380 [ 14.762027] ? _raw_spin_unlock_irqrestore+0x2d/0x60 [ 14.762442] ? cx25821_shutdown+0x20/0x9f0 [cx25821] [ 14.762848] cx25821_finidev+0x48/0xc0 [cx25821] [ 14.763242] pci_device_remove+0x92/0x240 Fix this by freeing the irq before call pci_disable_device(). Signed-off-by: Zheyu Ma Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/media/pci/cx25821/cx25821-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/pci/cx25821/cx25821-core.c b/drivers/media/pci/cx25821/cx25821-core.c index d58c58e61bde..acd896ca1339 100644 --- a/drivers/media/pci/cx25821/cx25821-core.c +++ b/drivers/media/pci/cx25821/cx25821-core.c @@ -1354,11 +1354,11 @@ static void cx25821_finidev(struct pci_dev *pci_dev) struct cx25821_dev *dev = get_cx25821(v4l2_dev); cx25821_shutdown(dev); - pci_disable_device(pci_dev); /* unregister stuff */ if (pci_dev->irq) free_irq(pci_dev->irq, dev); + pci_disable_device(pci_dev); cx25821_dev_unregister(dev); v4l2_device_unregister(v4l2_dev); -- 2.35.1