Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2266496iof; Wed, 8 Jun 2022 00:54:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy+HiYZYUKAr3kvBi+tMbkv6goHReQPtOAUN9DlT46P7H1QbjN5JKAaIccQL2Lsbs3jkwUi X-Received: by 2002:a17:903:22cb:b0:167:992f:60c3 with SMTP id y11-20020a17090322cb00b00167992f60c3mr5970484plg.59.1654674895562; Wed, 08 Jun 2022 00:54:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654674895; cv=none; d=google.com; s=arc-20160816; b=s04hemE4Fk9J4pNl9ylQQpjHsSRA8GqRkqvQMw2y6aw+zZgb/Pe2tNCnj/vCR35+sE uSOfAQ4LJIGKPdbEzHzdoELq3ZCOuguFvTUvWd8QnhU3B+AWSUy0dz3x12sEGAi+dHJH 9o/u6VyJsSjacKK2aEtOwXiFLzQ6CCD5cDZZWgih2BWsiyZct8Qq74E9cCNUkKxZr/dl k+KZOrWL2rdHyRwuwHHqv6yB22cWfNwmzURlbfrEfSiMSr0MLp+fRnnsgZztczlKdIkZ 5vXDL84+aMxI/JC8/N3uIS6EiG4ldhXPs5X4bAkqyWKYcGvkR2d+lQC7cOXDwE51eMtO MZXA== 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=BXykLux/ZT/eN/YsiQX5jeB7ZRJj0JSaKB/EiK9cGBE=; b=dmQuw5lDUAZJ2arkhLoKwaY1c/oX0+JiDsX9jwUGkjp9gZKL81OAgpZV0AWYnMSBAp E1TEg0gmflJigcawxj3lbCv6ngXFYgwPuVqwxzTMsdHiBO8ZUTWT0OTDt9DXTvl9aQ+P J9o9RBZz3unPHikGwOcG1XoDX8aRBQX4e1LJyIuuet/4UU0xHLIDJxIpInASVLm6i3Et /kH7MH2onGPkgabULwI4XqYS45o/hB3h+VEUeltXAdTXvlHPbwTAVClHH9s7ZmA9iggt hPXxTv0ls2CpDwDFH3ocxz2V9h+AhmGKltWXve0uEQwjuaA1aq7ZJ7nSgbWLz5Z/q+Yc RUdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ibQ01rOp; 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 q135-20020a632a8d000000b003f5fd4126b6si27647586pgq.716.2022.06.08.00.54.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jun 2022 00:54:55 -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=ibQ01rOp; 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 out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 416C11D8704; Wed, 8 Jun 2022 00:24:07 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346142AbiFGRWn (ORCPT + 99 others); Tue, 7 Jun 2022 13:22:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41232 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346008AbiFGRUK (ORCPT ); Tue, 7 Jun 2022 13:20:10 -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 73CA11059E1; Tue, 7 Jun 2022 10:20:05 -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 2E38CB822AF; Tue, 7 Jun 2022 17:20:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8076CC385A5; Tue, 7 Jun 2022 17:20:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654622402; bh=ugnEVQkrWoGa9gsUsWHCqnSwM+7baB/jOEkY17+HwqE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ibQ01rOpHuMHxGoUjlNqga0dP3IkcxcjHHBmIMRBQH+qU9u5FCK393S6PRl1J3CmV AvGqRSDPz1lwKy3tR7UYjUBxFR9l6/ctXbRmIqpw/6RAe6JKg8Ab6CIvgPiP2ob7EN VvXe2ViGFvTD3II3oP7klIocmy/e974kPP4abFhw= 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.10 046/452] media: cx25821: Fix the warning when removing the module Date: Tue, 7 Jun 2022 18:58:23 +0200 Message-Id: <20220607164909.920941751@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607164908.521895282@linuxfoundation.org> References: <20220607164908.521895282@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 285047b32c44..a3d45287a534 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