[rtems-libbsd commit] DEVFS(5): Properly initialize fp->f_cdevpriv

Sebastian Huber sebh at rtems.org
Wed Mar 28 06:00:06 UTC 2018


Module:    rtems-libbsd
Branch:    master
Commit:    8993827a739459c68ad689980b5be1dd07494192
Changeset: http://git.rtems.org/rtems-libbsd/commit/?id=8993827a739459c68ad689980b5be1dd07494192

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Tue Mar 27 14:40:19 2018 +0200

DEVFS(5): Properly initialize fp->f_cdevpriv

---

 rtemsbsd/sys/fs/devfs/devfs_devs.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/rtemsbsd/sys/fs/devfs/devfs_devs.c b/rtemsbsd/sys/fs/devfs/devfs_devs.c
index 7d89c49..7c697b0 100644
--- a/rtemsbsd/sys/fs/devfs/devfs_devs.c
+++ b/rtemsbsd/sys/fs/devfs/devfs_devs.c
@@ -98,6 +98,7 @@ devfs_imfs_open(rtems_libio_t *iop, const char *path, int oflag, mode_t mode)
 		}
 		fpop = td->td_fpop;
 		curthread->td_fpop = fp;
+		fp->f_cdevpriv = NULL;
 		error = dsw->d_open(cdev, oflag + 1, 0, td);
 		/* Clean up any cdevpriv upon error. */
 		if (error != 0)




More information about the vc mailing list