Fix #4125: NULL device is translated to '//'
The problem appeared to be on the request creating side (i.e. in the kernel add-on) which did not support NULL pointers properly. Relocation of addresses in request when it is received translates offset = 0, size = 0 to pointer NULL so that no change in that part of code was required. Signed-off-by: Ingo Weinhold <ingo_weinhold@gmx.de>
This commit is contained in:
parent
7c369a4b3f
commit
96944cbb3c
@ -264,13 +264,17 @@ status_t
|
||||
RequestAllocator::AllocateData(Address& address, const void* data, int32 size,
|
||||
int32 align, bool deferredInit)
|
||||
{
|
||||
void* destination;
|
||||
status_t error = AllocateAddress(address, size, align, &destination,
|
||||
deferredInit);
|
||||
if (error != B_OK)
|
||||
return error;
|
||||
if (size > 0)
|
||||
memcpy(destination, data, size);
|
||||
status_t error = B_OK;
|
||||
if (data != NULL) {
|
||||
void* destination;
|
||||
error = AllocateAddress(address, size, align, &destination,
|
||||
deferredInit);
|
||||
if (error != B_OK)
|
||||
return error;
|
||||
if (size > 0)
|
||||
memcpy(destination, data, size);
|
||||
} else
|
||||
address.SetTo(-1, 0, 0);
|
||||
return error;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user