Changeset cd3b380 in mainline for kernel/test/mm/falloc2.c


Ignore:
Timestamp:
2013-09-11T11:56:39Z (11 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
1db5669
Parents:
43dd8028
Message:

due to the removal of FRAME_KA, the return value of frame_alloc*() needs to be checked before converting the physical address to kernel address

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/test/mm/falloc2.c

    r43dd8028 rcd3b380  
    7474                        unsigned int allocated = 0;
    7575                        for (unsigned int i = 0; i < (MAX_FRAMES / count); i++) {
    76                                 frames[allocated] =
    77                                     PA2KA(frame_alloc(count, FRAME_ATOMIC, 0));
     76                                frames[allocated] = frame_alloc(count, FRAME_ATOMIC, 0);
    7877                                if (frames[allocated]) {
    79                                         memsetb((void *) frames[allocated], bytes, val);
     78                                        memsetb((void *) PA2KA(frames[allocated]), bytes, val);
    8079                                        allocated++;
    8180                                } else
     
    9190                        for (unsigned int i = 0; i < allocated; i++) {
    9291                                for (size_t k = 0; k < bytes; k++) {
    93                                         if (((uint8_t *) frames[i])[k] != val) {
     92                                        if (((uint8_t *) PA2KA(frames[i]))[k] != val) {
    9493                                                TPRINTF("Thread #%" PRIu64 " (cpu%u): "
    9594                                                    "Unexpected data (%c) in block %zu offset %zu\n",
    96                                                     THREAD->tid, CPU->id, ((char *) frames[i])[k],
     95                                                    THREAD->tid, CPU->id, ((char *) PA2KA(frames[i]))[k],
    9796                                                    frames[i], k);
    9897                                                atomic_inc(&thread_fail);
     
    10099                                        }
    101100                                }
    102                                 frame_free(KA2PA(frames[i]), count);
     101                                frame_free(frames[i], count);
    103102                        }
    104103                       
Note: See TracChangeset for help on using the changeset viewer.