summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2005-06-22 15:20:11 +0000
committerjhb <jhb@FreeBSD.org>2005-06-22 15:20:11 +0000
commit10ae787bfbad9af16740652a649882b41ff8596d (patch)
tree58d7996a2c3bb83de72d18202f4877dcd5a18404
parent557bdadf6654a364477fad611a28eac7294974df (diff)
downloadFreeBSD-src-10ae787bfbad9af16740652a649882b41ff8596d.zip
FreeBSD-src-10ae787bfbad9af16740652a649882b41ff8596d.tar.gz
Clear devinfo_generation in devinfo_free() since we are freeing all of the
cached state. Otherwise, a subsequent call to devinfo_init() would succeed without reading the device tree from the kernel thinking that the cached state was up to date since the generation count was the same. However, since the cached state was actually free'd, attempts to examine the tree after the second devinfo_init() would fail. Reported by: Juho Vuori juho dot vuori at kepa dot fi Submitted by: Stefan Farfeleder stefan at fafoe dot narf dot at Approved by: re (dwhite) MFC after: 1 week
-rw-r--r--lib/libdevinfo/devinfo.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/libdevinfo/devinfo.c b/lib/libdevinfo/devinfo.c
index a9734f9..5ad68c3 100644
--- a/lib/libdevinfo/devinfo.c
+++ b/lib/libdevinfo/devinfo.c
@@ -367,6 +367,7 @@ devinfo_free(void)
free(dr);
}
devinfo_initted = 0;
+ devinfo_generation = 0;
}
/*
OpenPOWER on IntegriCloud