Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp443999iog; Mon, 13 Jun 2022 06:07:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz/icu74DiVxWlfHvyUKbi1sF2B2L31vLHFXc1yFe9+C3VCFrj+YcncAhstutYl+/4PFmbh X-Received: by 2002:a63:1f55:0:b0:3fd:41c5:b53a with SMTP id q21-20020a631f55000000b003fd41c5b53amr42338654pgm.441.1655125632363; Mon, 13 Jun 2022 06:07:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655125632; cv=none; d=google.com; s=arc-20160816; b=L+6TjPrLdjHAAsijrTM/NSgz0MUGZ4axgb9S5f8kac9tL9V9FJQzD/ME9vlWswQ/pQ bKmsoJPLPrCW01NkNHU0Ct3UDW21TxUOIQ6zq0/UDIyc7+Rdye7jnahcCatTuABtGJPG G4Jw/Y53lx8anuSuOaNRNDukMMYYYTaJ8yS8f8s3NEjFApe7bfQpmA5bxcv7+GOP+zUJ Sgf/0B34Wzy+Ia8zgPsRX1Qbab21Hd7+9YNcWjlhbH4c43nCzQCxstu/io8a3cbRkqho v9RVrYkw8LrKKkMRzusK3KgwdYqAVWS+HNEtpg+qj2bIbQVdQTe0JqB0uoRkTZtGqzZf 4/3A== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=pQnfP8Eo2IKlouEWihmzIYLQ+bkmdm5hKJxA/Czj8Kc=; b=qDqwxz//x0/p/G4axs99ODIUTlnJw8n9KT0AUqOnrXy5V4omyI+vQw/wuqCaLISdXd rPXmwV4sonHzveU+yxqa7hs0qoNvdX9+SrvDbRj10OEH8mxt1g/8Eyc1EdFhErrpJ9jD UuqK+UPi8fq6Q8u3YvRRRMIXi0rNj9mFzf83qInajWHElOXmgG0RBBknRAlcO3qPSMli qZLCx/zyZUxCNJD1VQBGAO1PtsvvZypWUXBZQBlYqsK92uwUxs/TjjFBdUeKZwjE0udH 2j1MFpXzVmtqZalhJ2miqXHyrNg5rmbWyKty9vNDFjbzF8mBR8tUe1vkw7tkYwn50r01 hqtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=vIgeDl5c; 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=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b16-20020a170902d51000b0015eb08a71a6si10677168plg.16.2022.06.13.06.06.37; Mon, 13 Jun 2022 06:07:12 -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=@linuxfoundation.org header.s=korg header.b=vIgeDl5c; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349468AbiFMLAQ (ORCPT + 99 others); Mon, 13 Jun 2022 07:00:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43332 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350166AbiFMKyn (ORCPT ); Mon, 13 Jun 2022 06:54:43 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BC785E020; Mon, 13 Jun 2022 03:29:42 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 5ABE560F09; Mon, 13 Jun 2022 10:29:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6C669C34114; Mon, 13 Jun 2022 10:29:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1655116181; bh=AXOBA65BddkvlexoXP5FgrUhECKQc/p2tp+kkr1ZyVw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vIgeDl5cZq6xtHA/7sqncTSOTdtKT9L7ZMmT+YO5OqhHljx00Pm3/XPEhXHKpfPTC qQ6MQqfd0gmeuvJ7zQpRyeisXvxFfQi+A9VLG81+9E9JT1sYDwPzo7aTL1bsjQ2AnV eJn354sBjwvycdOi5rwVUYUA+IK3XwKdMD5eu8KQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Zheyu Ma , Hans Verkuil , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 5.4 028/411] media: cx25821: Fix the warning when removing the module Date: Mon, 13 Jun 2022 12:05:01 +0200 Message-Id: <20220613094929.346221037@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220613094928.482772422@linuxfoundation.org> References: <20220613094928.482772422@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-8.3 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 44839a6461e8..534829e352d1 100644 --- a/drivers/media/pci/cx25821/cx25821-core.c +++ b/drivers/media/pci/cx25821/cx25821-core.c @@ -1340,11 +1340,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