Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp597841iog; Mon, 13 Jun 2022 08:51:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxgnAgVPsWa+ylQ47CyO/7/bLowCjyw3WFSLfJBDHumonnHMRWYaduRgeQwBD4e4knheX3P X-Received: by 2002:a17:907:7da5:b0:711:c9cd:61e0 with SMTP id oz37-20020a1709077da500b00711c9cd61e0mr414735ejc.443.1655135513047; Mon, 13 Jun 2022 08:51:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655135513; cv=none; d=google.com; s=arc-20160816; b=Wpp0aM5PGm947NqMQDrzhj4IusWLr+VB/cAGm3BpZmwKRp7GPAUE5p/ukdpR1BAZoM tX6UhD7wEiibfS+fVrCGRj2PVg+GHJJQDG4glEOZaMkpeRHF/V6bQtdfn6XEN+HQEJrQ sHr64PbxGtXWZKoQ+PPUcif0bGC2o+2bZcxEKpXggH0yv+3jYeUz/kyTATMxf5nWD+rY mIJ2lbQ8LwnepIXcbZ1BXgAXQKFD7/RF9qpec/1rvbMMCSv4eWw33rWGLsOmZOUx0vjT b8GRY62JoKsRAqbinQgBA/+W3fujpvijhjHOdRcZriVO70MekS5jUQGk4wYoZ72dS3Hd rdLA== 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=fP3CM/K1gMbTks950UTYn1EjN0pCSKy380VQ+6sAfXw=; b=AbacL4fDpQHez4t/0UoAM939N8wLde6I8MWYA66hQ+QovkFLnJ6SA8NWmaV5115l2z gdyjBpRcvbu176DqQOmmGVaofK4vQ3GJir2m8RzuxCujhO68gpBcg9AqcdsGJmFx7ogY EygzvmKLNrRDKP4wYKY+dQuie/NOaFqZhOS0igCXshnC6TI705dy3SWfs3Bh7kUEM9vv lXaRXXORPSh8MoRSFBTThIfZa4JuMMvXOSdK6CyZnCVjx1rwu0RrK43IHGJKyvidv4d2 hgycyC43qkcsUUFceg8zueDnTbfevY02OHMo1fnWzW/LATMBSX8CjHwbP0COKNAaZNdU pemQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=BELpSgBO; 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 r9-20020aa7d589000000b0042dd47aecd0si7495379edq.444.2022.06.13.08.51.28; Mon, 13 Jun 2022 08:51:53 -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=BELpSgBO; 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 S1356066AbiFMLnn (ORCPT + 99 others); Mon, 13 Jun 2022 07:43:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43856 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355525AbiFMLjI (ORCPT ); Mon, 13 Jun 2022 07:39:08 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 59DE72C119; Mon, 13 Jun 2022 03:48:49 -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 E9BE36112A; Mon, 13 Jun 2022 10:48:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 00AB7C34114; Mon, 13 Jun 2022 10:48:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1655117328; bh=1ZG1JySuWceOc9T7kfMLbN7XXqvVOPvIff+FirOxY38=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BELpSgBOs86PpO82p8risPUE6OgikLpbUd4KYBwA8/rClaN4V7+DlARoJHIHQ0O98 91ztTTnCEqikEGeAQNS0+iqCs0hZPAXAi+SImkuo9KSZkotvolQoivd7n0OQENVC6u TABfSgkbdTR4GHksjbYE1AViq0TPlAm8vSxE5gzI= 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 4.19 022/287] media: cx25821: Fix the warning when removing the module Date: Mon, 13 Jun 2022 12:07:26 +0200 Message-Id: <20220613094924.534679502@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220613094923.832156175@linuxfoundation.org> References: <20220613094923.832156175@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 e04fe9f17b7a..99359eaf8cdc 100644 --- a/drivers/media/pci/cx25821/cx25821-core.c +++ b/drivers/media/pci/cx25821/cx25821-core.c @@ -1350,11 +1350,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