summaryrefslogtreecommitdiffstats
path: root/sys/dev/ksyms
diff options
context:
space:
mode:
authorhselasky <hselasky@FreeBSD.org>2012-08-15 16:19:39 +0000
committerhselasky <hselasky@FreeBSD.org>2012-08-15 16:19:39 +0000
commitcd2aff73464a800a4055a28629369fe7640150be (patch)
tree1000f4d07590bc41e68544d52176932383b84915 /sys/dev/ksyms
parentc92e1b68a6eaa87cbe2e4382cf95fd57d37583b7 (diff)
downloadFreeBSD-src-cd2aff73464a800a4055a28629369fe7640150be.zip
FreeBSD-src-cd2aff73464a800a4055a28629369fe7640150be.tar.gz
Streamline use of cdevpriv and correct some corner cases.
1) It is not useful to call "devfs_clear_cdevpriv()" from "d_close" callbacks, hence for example read, write, ioctl and so on might be sleeping at the time of "d_close" being called and then then freed private data can still be accessed. Examples: dtrace, linux_compat, ksyms (all fixed by this patch) 2) In sys/dev/drm* there are some cases in which memory will be freed twice, if open fails, first by code in the open routine, secondly by the cdevpriv destructor. Move registration of the cdevpriv to the end of the drm open routines. 3) devfs_clear_cdevpriv() is not called if the "d_open" callback registered cdevpriv data and the "d_open" callback function returned an error. Fix this. Discussed with: phk MFC after: 2 weeks
Diffstat (limited to 'sys/dev/ksyms')
-rw-r--r--sys/dev/ksyms/ksyms.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/sys/dev/ksyms/ksyms.c b/sys/dev/ksyms/ksyms.c
index 49298bc..61729210 100644
--- a/sys/dev/ksyms/ksyms.c
+++ b/sys/dev/ksyms/ksyms.c
@@ -579,8 +579,6 @@ ksyms_close(struct cdev *dev, int flags __unused, int fmt __unused,
/* Unmap the buffer from the process address space. */
error = copyout_unmap(td, sc->sc_uaddr, sc->sc_usize);
- devfs_clear_cdevpriv();
-
return (error);
}
OpenPOWER on IntegriCloud