Ticket #4125: 4125.patch

File 4125.patch, 988 bytes (added by pdziepak, 13 years ago)
  • src/add-ons/kernel/file_systems/userlandfs/private/RequestAllocator.cpp

    diff --git a/src/add-ons/kernel/file_systems/userlandfs/private/RequestAllocator.cpp b/src/add-ons/kernel/file_systems/userlandfs/private/RequestAllocator.cpp
    index 0316b56..a20be1b 100644
    a b status_t  
    264264RequestAllocator::AllocateData(Address& address, const void* data, int32 size,
    265265    int32 align, bool deferredInit)
    266266{
    267     void* destination;
    268     status_t error = AllocateAddress(address, size, align, &destination,
    269         deferredInit);
    270     if (error != B_OK)
    271         return error;
    272     if (size > 0)
    273         memcpy(destination, data, size);
     267    status_t error = B_OK;
     268    if (data) {
     269        void* destination;
     270        error = AllocateAddress(address, size, align, &destination,
     271            deferredInit);
     272        if (error != B_OK)
     273            return error;
     274        if (size > 0)
     275            memcpy(destination, data, size);
     276    } else
     277        address.SetTo(-1, 0, 0);
    274278    return error;
    275279}
    276280