summaryrefslogtreecommitdiffstats
path: root/cpukit
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2010-07-23 00:11:32 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2010-07-23 00:11:32 +0000
commit336457634453acfaa09ebc4e9bc0491862c568fb (patch)
tree82763c314f553063a02200774e22dd4f893a2aae /cpukit
parent2010-07-22 Bharath Suri <bharath.s.jois@gmail.com> (diff)
downloadrtems-336457634453acfaa09ebc4e9bc0491862c568fb.tar.bz2
2010-07-22 Joel Sherrill <joel.sherrill@oarcorp.com>
PR 1627/testing * libfs/src/devfs/devstat.c:
Diffstat (limited to 'cpukit')
-rw-r--r--cpukit/ChangeLog5
-rw-r--r--cpukit/libfs/src/devfs/devstat.c14
2 files changed, 15 insertions, 4 deletions
diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog
index cbadd0f700..e7b4cd6ec5 100644
--- a/cpukit/ChangeLog
+++ b/cpukit/ChangeLog
@@ -1,3 +1,8 @@
+2010-07-22 Joel Sherrill <joel.sherrill@oarcorp.com>
+
+ PR 1627/testing
+ * libfs/src/devfs/devstat.c:
+
2010-07-16 Sebastian Huber <sebastian.huber@embedded-brains.de>
* libcsupport/src/link.c: Do not overwrite errno with return status.
diff --git a/cpukit/libfs/src/devfs/devstat.c b/cpukit/libfs/src/devfs/devstat.c
index 7bfdfec00c..db17595621 100644
--- a/cpukit/libfs/src/devfs/devstat.c
+++ b/cpukit/libfs/src/devfs/devstat.c
@@ -27,13 +27,19 @@ int devFS_stat(
rtems_device_name_t *the_dev;
the_dev = (rtems_device_name_t *)loc->node_access;
- if (!the_dev)
- rtems_set_errno_and_return_minus_one( EFAULT );
- buf->st_rdev = rtems_filesystem_make_dev_t( the_dev->major, the_dev->minor );
+ /*
+ * stat() invokes devFS_evaluate_path() which checks that node_access
+ * is not NULL. So this should NEVER be NULL unless someone breaks
+ * other code in this filesystem.
+ */
+ #if defined(RTEMS_DEBUG)
+ if (!the_dev)
+ rtems_set_errno_and_return_minus_one( EFAULT );
+ #endif
+ buf->st_rdev = rtems_filesystem_make_dev_t( the_dev->major, the_dev->minor );
buf->st_mode = the_dev->mode;
-
return 0;
}