Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2181762iof; Tue, 7 Jun 2022 22:24:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwtPNNr2E/bQYSma38voigR/NTYnoWseWgGyGUlcTor0UZ4j96HGGVQBX0P8Vvy00Pp6lCW X-Received: by 2002:a63:5b5d:0:b0:3fc:97d5:f8b2 with SMTP id l29-20020a635b5d000000b003fc97d5f8b2mr28987308pgm.322.1654665898674; Tue, 07 Jun 2022 22:24:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654665898; cv=none; d=google.com; s=arc-20160816; b=CaZGrmAZzZM1zGmJUhcs/EFWHcYiL3+oG7TRuBInXfoJ78IIa+GX6FWH7nYDDxll08 +jnTFiFeG3q8EuRhuAzI5k64YDRt+57H9EddYyZfetwFOn01XrZtzpXqyPOS2Jei6XSg GD1RYnf7qJjb5E974/MGPXKL0u3R3wehzqj6FP7msfmyr/J5zXIgKkZ/u1dsiAKcbsxv WQ8se8ZmRWI/dqTAdAsG8IsB7MTuCq9fRlYJ3/d5DjwTL9VktzUu3h5f9Qk20eT5gPI7 TSggfQs+I/gAxadhAAgEJ5nrHhxsvFQCq/iXKHM6KZuJHeHEYpnentSChzTIrBuPgwD6 jU8A== 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=T3Zm0jPboUfGz6rY9SVSGxbvlNxF4DnnFaO2f0yWBBM=; b=CMqsNSCDkqCki/HtIgkrNNJ+r9Qrzo8tRKe6rD81iRFTUhWk9w+WWDee13EWNI5Fgr RIhvrZn69xpmPyJmvK+f5DSHN0Zqu5aLdDLUD4sgAws9joJNhSKquWVtRXeVepjiXjHd pjc8HHLclDBE2tigFqXaNTsD9iH+KPz59OUKHCNNk7gYiVZC82zowLzQXK4+wAvSL1dJ V7KQIoT0AsjU7lJy/O0XWR+9O143YIHBA/eggvnZaG452AJ+JKxrgfvDFHmb4tYEwl/V sdg8xcV11FwSHbgusjq204ufrAEmdLE3k47sLlQemZDDsi70F5F9JmrIFbSekH5b5Xc4 UftQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=X90pSdWt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id q7-20020a056a00088700b004fa3a8dffdfsi30456865pfj.150.2022.06.07.22.24.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 22:24:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=X90pSdWt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 077F3472B93; Tue, 7 Jun 2022 21:51:45 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344801AbiFGSX4 (ORCPT + 99 others); Tue, 7 Jun 2022 14:23:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39610 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350000AbiFGSAk (ORCPT ); Tue, 7 Jun 2022 14:00:40 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 691E012817C; Tue, 7 Jun 2022 10:42:34 -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 1C626B80B66; Tue, 7 Jun 2022 17:42:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 643E4C385A5; Tue, 7 Jun 2022 17:42:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654623747; bh=uk1qdW7JoKuQum18G3aYe+yII2qPfO4rIYEGwtqwbTk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=X90pSdWtzxQeLN6Sxul3YRb5rPv4w0d8vxWr3c6e3oA0VFgiWuCKYIShNMR0/cipy m0xmgxefYmdgsNrLxu0SgC43gSosCHDagDKiFvUiQ7PF/MFsayPslNbEZ/FUextWd3 YjtQJ3Dc+R8Iv1lysTOObBrTd686kDMHFxIS4qpw= 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.15 076/667] media: cx25821: Fix the warning when removing the module Date: Tue, 7 Jun 2022 18:55:41 +0200 Message-Id: <20220607164937.098836562@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607164934.766888869@linuxfoundation.org> References: <20220607164934.766888869@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=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 40c10ca94def..a4192e80e9a0 100644 --- a/drivers/media/pci/cx25821/cx25821-core.c +++ b/drivers/media/pci/cx25821/cx25821-core.c @@ -1339,11 +1339,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