Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp4440363pxb; Mon, 21 Feb 2022 21:41:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJykBiGSFguIDRHy7IhHO4310lsnRDPtKBXMaq3Hh8tEISdnaOk6c2HDtx1hAI49FAIG2rxM X-Received: by 2002:a17:90b:1896:b0:1bc:62f1:d859 with SMTP id mn22-20020a17090b189600b001bc62f1d859mr2476116pjb.18.1645508485291; Mon, 21 Feb 2022 21:41:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645508485; cv=none; d=google.com; s=arc-20160816; b=qC63TBDXDLo8YpuLOuaYtPka4QInzHk9zC8yDtisxpULP4NLwXxyE8YsV0d273cY3S p+YgWnwajlhb5vf6d/pa/1tO2pEqz95ottwc0QfN46XBwLskbpIwX1N9FdI4JDENSJ/1 aBByp36fGLSoZn1NvLjXZjNKPORT7Gbh0JscoRGlaiyxR4AvS5YgIK0AyCrjRH3DXvIF OwBr2l/z81lL+XVW809cdBocp30g83FjWo8p5eieCeXh5cl5Kpe7jZHPNvgiYz9L7EXa k7qQlpj3IkDXFvfILxLeY3W4jLhJr+qwe2pAajZr3m/jmQ6M8fBkgzZAjCsbKqOAJQ7x d85g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=xmtio8m3+nlYW5nqf6a66VzrCrPg1cN1ZsCw8f7JSBs=; b=O6HTrDyV4ktqsReEIodAO10zxTPN+zj2jRDkXjqaQDBZRLLwxna97wDyGbsBhXJB/M TwA2jtT3DsNtVY5nENNvKbh03S+sJ2eQIoFmrRCGBD1+O1lHkwh0DNYjhBeIKFUf4za3 o1PNeJPeRICP1eyWEDhQY1aF8Rpt2V3YKNAvD8LcB59tRknRU8b5szCIUdNyKcU7r93d 8CTpNsB50qfm1Gl2Nlv5GUmeA/1pPPmgB0xs4/HJg39Wlq+6V8DH6ozZgo0ozs+xvPjP lcqHFNS6afXvndm8JQnSgt43U+UFUyiKxd0d4kFW61BJ1aiGb+/IjYJr0IHzqi90+lCv pstg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="1HX/pX2M"; 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 h11si2822811pgm.505.2022.02.21.21.41.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Feb 2022 21:41:25 -0800 (PST) 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="1HX/pX2M"; 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 7BC07C334F; Mon, 21 Feb 2022 21:07:41 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1381580AbiBURQw (ORCPT + 99 others); Mon, 21 Feb 2022 12:16:52 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:41406 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1381581AbiBURQu (ORCPT ); Mon, 21 Feb 2022 12:16:50 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C6A9426122 for ; Mon, 21 Feb 2022 09:16:25 -0800 (PST) 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 640216144F for ; Mon, 21 Feb 2022 17:16:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 49E2DC340E9; Mon, 21 Feb 2022 17:16:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1645463784; bh=hOo8EVPxASwZeK28tfDq8KEHLaCOknGxUF68Yqnl/sg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=1HX/pX2MsbcEs6iGjOcwfoko6GxCKx9gkE8DhyVnQx7swBLTeHG6rBzf9cYvWhVUq JBXQ19OlMZuHftENRuUMMgbotQk9eSaLETWRXD+mDhfQBqSVNtac6FTVJRaihDu0tX Wwh4SvzmLzNKaQhJShwW+r4lhS2fc8FrKT2AZKwA= Date: Mon, 21 Feb 2022 18:16:22 +0100 From: Greg Kroah-Hartman To: Tong Zhang Cc: Jakub Kicinski , Lee Jones , Colin Ian King , Saurav Girepunje , Johan Hovold , =?iso-8859-1?Q?Cl=E1udio?= Maia , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH] staging: rtl8192u: cleanup proc fs entries upon exit Message-ID: References: <20220220231554.2510567-1-ztong0001@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220220231554.2510567-1-ztong0001@gmail.com> X-Spam-Status: No, score=-2.0 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=no 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 On Sun, Feb 20, 2022 at 03:15:53PM -0800, Tong Zhang wrote: > proc fs entries need to be removed when module is removed, otherwise > when we try to insert the module again, kernel will complain > > [ 493.068012] proc_dir_entry 'net/ieee80211' already registered > [ 493.271973] proc_mkdir+0x18/0x20 > [ 493.272136] ieee80211_debug_init+0x28/0xde8 [r8192u_usb] > [ 493.272404] rtl8192_usb_module_init+0x10/0x161 [r8192u_usb] > > [ 13.910616] proc_dir_entry 'net/rtl819xU' already registered > [ 13.918931] proc_mkdir+0x18/0x20 > [ 13.919098] rtl8192_usb_module_init+0x142/0x16d [r8192u_usb] > > Signed-off-by: Tong Zhang > --- > drivers/staging/rtl8192u/r8192U_core.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c > index 364e1ca94f70..683afdc667bc 100644 > --- a/drivers/staging/rtl8192u/r8192U_core.c > +++ b/drivers/staging/rtl8192u/r8192U_core.c > @@ -4825,6 +4825,11 @@ static int __init rtl8192_usb_module_init(void) > static void __exit rtl8192_usb_module_exit(void) > { > usb_deregister(&rtl8192_usb_driver); > + remove_proc_entry(RTL819XU_MODULE_NAME, init_net.proc_net); > + > +#ifdef CONFIG_IEEE80211_DEBUG > + ieee80211_debug_exit(); > +#endif Please do not put #ifdef in .c files. They should be in a .h file instead. thanks, greg k-h