Changeset bb01a36 in rtems


Ignore:
Timestamp:
Jul 19, 2017, 2:59:16 PM (2 years ago)
Author:
Kevin Kirspel <kevin-kirspel@…>
Branches:
master
Children:
b965f461
Parents:
5f1ae90e
git-author:
Kevin Kirspel <kevin-kirspel@…> (07/19/17 14:59:16)
git-committer:
Sebastian Huber <sebastian.huber@…> (07/20/17 05:25:43)
Message:

Fixed issue with searching mapped addresses

The loop that checks if the current address is already mapped uses
the same local variable for the chanin node as the newly allocated
chain node so the allocated chain node gets over written.

Added a new local variable for the loop that checks the address

Updates #2859.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/posix/src/mmap.c

    r5f1ae90e rbb01a36  
    115115  struct stat     sb;
    116116  mmap_mapping   *mapping;
     117  mmap_mapping   *current_mapping;
    117118  ssize_t         r;
    118119  rtems_libio_t  *iop;
     
    320321       * the overlapping prior mappings.
    321322       */
    322       mapping = (mmap_mapping*) node;
    323       if ( ( addr >= mapping->addr ) &&
    324            ( addr < ( mapping->addr + mapping->len )) ) {
     323      current_mapping = (mmap_mapping*) node;
     324      if ( ( addr >= current_mapping->addr ) &&
     325           ( addr < ( current_mapping->addr + current_mapping->len )) ) {
    325326        free( mapping );
    326327        mmap_mappings_lock_release( );
Note: See TracChangeset for help on using the changeset viewer.