Changeset 2d9197e in mainline


Ignore:
Timestamp:
2012-07-14T09:52:28Z (12 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
d30292e
Parents:
a27d1c5
Message:

sb16: Return NULL rather than invalid buffer.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/audio/sb16/dma.h

    ra27d1c5 r2d9197e  
    3535#define DRV_AUDIO_SB16_DMA_H
    3636
    37 #include <assert.h>
    3837#include <errno.h>
    39 #include <malloc.h>
    4038#include <mem.h>
    4139#include <as.h>
     
    7472        uintptr_t ptr = 0;
    7573        as_get_physical_mapping(address, &ptr);
    76         ddf_log_verbose("Buffer mapped at %x.", ptr);
     74        if ((ptr & 0xffffff) != ptr) {
     75                ddf_log_debug("%s: Can not provide invalid buffer %x.",
     76                    __FUNCTION__, ptr);
     77                as_area_destroy(address);
     78                return NULL;
     79        }
     80        ddf_log_verbose("%s: Buffer mapped at %x.", __FUNCTION__, ptr);
    7781        return address;
    7882}
Note: See TracChangeset for help on using the changeset viewer.