From nobody Sun Oct 22 10:29:53 2023 X-Original-To: freebsd-drivers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SCvhw4NtJz4yMQG for ; Sun, 22 Oct 2023 10:30:08 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4SCvhw1BbRz3QKj for ; Sun, 22 Oct 2023 10:30:08 +0000 (UTC) (envelope-from kostikbel@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: from tom.home (kib@localhost [127.0.0.1] (may be forged)) by kib.kiev.ua (8.17.1/8.17.1) with ESMTP id 39MATrO6085213; Sun, 22 Oct 2023 13:29:56 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 39MATrO6085213 Received: (from kostik@localhost) by tom.home (8.17.1/8.17.1/Submit) id 39MATr0G085212; Sun, 22 Oct 2023 13:29:53 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 22 Oct 2023 13:29:53 +0300 From: Konstantin Belousov To: YU SHANG Cc: "freebsd-drivers@freebsd.org" Subject: Re: =?utf-8?B?5Zue5aSN?= =?utf-8?Q?=3A?= about devfs_free Message-ID: References: List-Id: Writing device drivers for FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-drivers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-drivers@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=0.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM,FREEMAIL_REPLY, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=4.0.0 X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-14) on tom.home X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] X-Rspamd-Queue-Id: 4SCvhw1BbRz3QKj On Sun, Oct 22, 2023 at 10:10:52AM +0000, YU SHANG wrote: > I’m sorry. I’ve found it will be detached from cdevp_list in devfs_revoke. Drivers should not touch this level of interfaces. Read make_dev(9)/destroy_dev(9) man pages about management of cdevs from the driver side. > > > 发件人: YU SHANG > 发送时间: 2023年10月19日 18:45 > 收件人: freebsd-drivers@freebsd.org > 主题: about devfs_free > > Hi guys, > I am a newbie in FreeBSD driver development. I found that devfs_free(sys\fs\devfs\devfs_devs.c) does not detach the cdev_priv from the cdevp_list before free it. cdev_priv is inserted into cdevp_list in devfs_create(sys\fs\devfs\devfs_devs.c). What I have missed? Many thank. > >