Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 16 Oct 2023 07:16:35 GMT
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 23a55498a818 - stable/14 - vkbd: correct ref count on cloned cdevs
Message-ID:  <202310160716.39G7GZmx054825@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/14 has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=23a55498a8184add2396479a09c7ba0921d057a4

commit 23a55498a8184add2396479a09c7ba0921d057a4
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2023-10-02 22:25:52 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2023-10-16 07:16:01 +0000

    vkbd: correct ref count on cloned cdevs
    
    (cherry picked from commit 6e92fc930943a85f311e986a02e2b3dae9e37126)
---
 sys/dev/vkbd/vkbd.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sys/dev/vkbd/vkbd.c b/sys/dev/vkbd/vkbd.c
index a8d4583f46c7..3dbf64063e33 100644
--- a/sys/dev/vkbd/vkbd.c
+++ b/sys/dev/vkbd/vkbd.c
@@ -191,6 +191,8 @@ vkbd_dev_clone(void *arg, struct ucred *cred, char *name, int namelen,
 		*dev = make_dev_credf(MAKEDEV_REF, &vkbd_dev_cdevsw, unit,
 			cred, UID_ROOT, GID_WHEEL, 0600, DEVICE_NAME "%d",
 			unit);
+	else
+		dev_ref(*dev);
 }
 
 /* Open device */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202310160716.39G7GZmx054825>