Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Feb 2004 20:32:52 +0000 (UTC)
From:      "Bjoern A. Zeeb" <bzeeb-lists@lists.zabbadoz.net>
To:        FreeBSD current mailing list <current@freebsd.org>
Cc:        "Bjoern A. Zeeb" <bzeeb+freebsd@zabbadoz.net>
Subject:   dev/random duplicate call to destroy_dev
Message-ID:  <Pine.BSF.4.53.0402122023480.69801@e0-0.zab2.int.zabbadoz.net>

next in thread | raw e-mail | index | archive | help
Hi,

when unloading random module destry_dev also gets called for dev_t
aquired with make_dev_alias which is wrong according to make_dev(9).

Seems this has been living in there for 3y7m now ...
http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/dev/random/randomdev.c.diff?r1=1.3&r2=1.4

possible yet untested fix:

--- sys/dev/random/randomdev.c.orig	Thu Feb 12 20:12:58 2004
+++ sys/dev/random/randomdev.c	Thu Feb 12 20:25:26 2004
@@ -104,7 +104,6 @@ static struct proc *random_kthread_proc;

 /* For use with make_dev(9)/destroy_dev(9). */
 static dev_t	random_dev;
-static dev_t	urandom_dev;

 /* ARGSUSED */
 static int
@@ -266,7 +265,7 @@ random_modevent(module_t mod __unused, i
 			printf("random: <entropy source>\n");
 		random_dev = make_dev(&random_cdevsw, RANDOM_MINOR, UID_ROOT,
 			GID_WHEEL, 0666, "random");
-		urandom_dev = make_dev_alias(random_dev, "urandom");
+		(void)make_dev_alias(random_dev, "urandom");

 		/* Start the hash/reseed thread */
 		error = kthread_create(random_kthread, NULL,
@@ -309,7 +308,6 @@ random_modevent(module_t mod __unused, i
 		random_deinit();

 		destroy_dev(random_dev);
-		destroy_dev(urandom_dev);
 		return 0;

 	case MOD_SHUTDOWN:

-- 
Bjoern A. Zeeb				bzeeb at Zabbadoz dot NeT
56 69 73 69 74				http://www.zabbadoz.net/



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