Changeset 6659037 in mainline


Ignore:
Timestamp:
2012-10-14T13:16:14Z (12 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
274bbcc7
Parents:
9f4067b6
Message:

libc: Check parameter in pio_enable.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/ddi.c

    r9f4067b6 r6659037  
    136136 * @param size     Size of the I/O region.
    137137 * @param virt     Virtual address for application's
    138  *                 PIO operations.
     138 *                 PIO operations. Can be NULL for PMIO.
    139139 *
    140140 * @return EOK on success.
     
    146146#ifdef IO_SPACE_BOUNDARY
    147147        if (pio_addr < IO_SPACE_BOUNDARY) {
    148                 *virt = pio_addr;
     148                if (virt)
     149                        *virt = pio_addr;
    149150                return iospace_enable(task_get_id(), pio_addr, size);
    150151        }
    151152#endif
    152        
     153        if (!virt)
     154                return EINVAL;
     155
    153156        void *phys_frame =
    154157            (void *) ALIGN_DOWN((uintptr_t) pio_addr, PAGE_SIZE);
Note: See TracChangeset for help on using the changeset viewer.