diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2010-08-23 21:29:31 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2010-08-23 21:29:31 +0000 |
commit | 85b9e7fd96f81951eba685ea83b090331238675e (patch) | |
tree | 81deb184caf918773881f3f88d961ebf702c8143 /cpukit | |
parent | 2010-08-23 Joel Sherrill <joel.sherrilL@OARcorp.com> (diff) | |
download | rtems-85b9e7fd96f81951eba685ea83b090331238675e.tar.bz2 |
2010-08-23 Joel Sherrill <joel.sherrill@oarcorp.com>
CID 99
CID 100
CID 101
CID 102
* libfs/src/dosfs/fat_file.c, libfs/src/dosfs/msdos.h,
libfs/src/dosfs/msdos_misc.c: Resolve invalid use of const identified
by Coverity scanner.
Diffstat (limited to 'cpukit')
-rw-r--r-- | cpukit/ChangeLog | 10 | ||||
-rw-r--r-- | cpukit/libfs/src/dosfs/fat_file.c | 10 | ||||
-rw-r--r-- | cpukit/libfs/src/dosfs/msdos.h | 4 | ||||
-rw-r--r-- | cpukit/libfs/src/dosfs/msdos_misc.c | 4 |
4 files changed, 21 insertions, 7 deletions
diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog index 85e1423e26..80df7dbd02 100644 --- a/cpukit/ChangeLog +++ b/cpukit/ChangeLog @@ -1,3 +1,13 @@ +2010-08-23 Joel Sherrill <joel.sherrill@oarcorp.com> + + CID 99 + CID 100 + CID 101 + CID 102 + * libfs/src/dosfs/fat_file.c, libfs/src/dosfs/msdos.h, + libfs/src/dosfs/msdos_misc.c: Resolve invalid use of const identified + by Coverity scanner. + 2010-08-23 Sebastian Huber <sebastian.huber@embedded-brains.de> PR 1673/cpukit diff --git a/cpukit/libfs/src/dosfs/fat_file.c b/cpukit/libfs/src/dosfs/fat_file.c index 0cd5f286db..0a9b790c10 100644 --- a/cpukit/libfs/src/dosfs/fat_file.c +++ b/cpukit/libfs/src/dosfs/fat_file.c @@ -691,22 +691,25 @@ fat_file_ioctl( ret = va_arg(ap, uint32_t *); /* sanity check */ - if ( pos >= fat_fd->fat_file_size ) + if ( pos >= fat_fd->fat_file_size ) { + va_end(); rtems_set_errno_and_return_minus_one( EIO ); + } if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) { /* cluster 0 (zero) reserved for root dir */ *ret = 0; - return RC_OK; + rc = RC_OK; + break; } cl_start = pos >> fs_info->vol.bpc_log2; rc = fat_file_lseek(mt_entry, fat_fd, cl_start, &cur_cln); if ( rc != RC_OK ) - return rc; + break; *ret = cur_cln; break; @@ -716,6 +719,7 @@ fat_file_ioctl( rc = -1; break; } + va_end(ap); return rc; } diff --git a/cpukit/libfs/src/dosfs/msdos.h b/cpukit/libfs/src/dosfs/msdos.h index 2740f98204..04814761d0 100644 --- a/cpukit/libfs/src/dosfs/msdos.h +++ b/cpukit/libfs/src/dosfs/msdos.h @@ -179,8 +179,8 @@ typedef rtems_filesystem_node_types_t msdos_node_type_t; #define MSDOS_NAME_MAX_LFN_WITH_DOT (260) -extern const char const* MSDOS_DOT_NAME; /* ".", padded to MSDOS_NAME chars */ -extern const char const* MSDOS_DOTDOT_NAME; /* ".", padded to MSDOS_NAME chars */ +extern const char *const MSDOS_DOT_NAME; /* ".", padded to MSDOS_NAME chars */ +extern const char *const MSDOS_DOTDOT_NAME; /* ".", padded to MSDOS_NAME chars */ typedef enum msdos_name_types_e { diff --git a/cpukit/libfs/src/dosfs/msdos_misc.c b/cpukit/libfs/src/dosfs/msdos_misc.c index 02835e13a0..864025ff10 100644 --- a/cpukit/libfs/src/dosfs/msdos_misc.c +++ b/cpukit/libfs/src/dosfs/msdos_misc.c @@ -40,8 +40,8 @@ /* * External strings. Saves spave this way. */ -const char const* MSDOS_DOT_NAME = ". "; -const char const* MSDOS_DOTDOT_NAME = ".. "; +const char *const MSDOS_DOT_NAME = ". "; +const char *const MSDOS_DOTDOT_NAME = ".. "; /* msdos_is_valid_name_char -- * Routine to check the character in a file or directory name. |