Changeset 14741a0 in mainline for kernel/generic/src/ddi/ddi.c


Ignore:
Timestamp:
2017-11-15T00:15:46Z (6 years ago)
Author:
Aearsis <Hlavaty.Ondrej@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
517c67ab
Parents:
6ba2db4b
Message:

ddi: do not assume arguments are correct

When an uspace app requests to map 0 bytes, dmamem_map_anonymous calls
frame_alloc, which asserts the size is not zero, causing kernel panic.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/ddi/ddi.c

    r6ba2db4b r14741a0  
    382382       
    383383        size_t frames = SIZE2FRAMES(size);
     384        if (frames == 0)
     385                return EINVAL;
     386
    384387        *phys = frame_alloc(frames, FRAME_ATOMIC, constraint);
    385388        if (*phys == 0)
Note: See TracChangeset for help on using the changeset viewer.