summaryrefslogtreecommitdiffstats
path: root/cpukit/libfs
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2010-01-19 01:55:28 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2010-01-19 01:55:28 +0000
commitad7824bc9e3d8b08fca3965cf2a3ca1c40138fbc (patch)
treecade3462aab2350dd9623af297ebcbc01ce05a69 /cpukit/libfs
parent2010-01-18 Joel Sherrill <joel.sherrill@oarcorp.com> (diff)
downloadrtems-ad7824bc9e3d8b08fca3965cf2a3ca1c40138fbc.tar.bz2
2010-01-18 Joel Sherrill <joel.sherrill@oarcorp.com>
Coverity Id 12 * libfs/src/imfs/memfile.c: Check for NULL return value.
Diffstat (limited to 'cpukit/libfs')
-rw-r--r--cpukit/libfs/src/imfs/memfile.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/cpukit/libfs/src/imfs/memfile.c b/cpukit/libfs/src/imfs/memfile.c
index 08c426d5da..e0429b3e92 100644
--- a/cpukit/libfs/src/imfs/memfile.c
+++ b/cpukit/libfs/src/imfs/memfile.c
@@ -7,7 +7,7 @@
* at system shutdown unless special arrangements to copy the data to
* some type of non-volailte storage are made by the application.
*
- * COPYRIGHT (c) 1989-1999.
+ * COPYRIGHT (c) 1989-2010.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -399,14 +399,16 @@ MEMFILE_STATIC int IMFS_memfile_remove_block(
unsigned int block
)
{
- block_p *block_entry_ptr;
+ block_p *block_ptr;
block_p ptr;
- block_entry_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 );
- ptr = *block_entry_ptr;
- *block_entry_ptr = 0;
-
- memfile_free_block( ptr );
+ block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 );
+ assert( block_ptr );
+ if ( block_ptr ) {
+ ptr = *block_ptr;
+ *block_ptr = 0;
+ memfile_free_block( ptr );
+ }
return 1;
}