virtio RNG: fix SMAP violation
Change-Id: I82fadcef6d3f402b10273b6f378d5357f3c835c3 Reviewed-on: https://review.haiku-os.org/c/haiku/+/3716 Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
This commit is contained in:
parent
e248c98eb8
commit
c05253c64e
@ -117,7 +117,8 @@ VirtioRNGDevice::Read(void* _buffer, size_t* _numBytes)
|
||||
|
||||
if (fOffset < BUFFER_SIZE) {
|
||||
size_t size = min_c(BUFFER_SIZE - fOffset, *_numBytes);
|
||||
memcpy(_buffer, fBuffer + fOffset, size);
|
||||
if (user_memcpy(_buffer, fBuffer + fOffset, size) != B_OK)
|
||||
return B_BAD_ADDRESS;
|
||||
fOffset += size;
|
||||
*_numBytes = size;
|
||||
} else
|
||||
|
Loading…
Reference in New Issue
Block a user