Commit b9811b0a authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] ppc64: HvCall_writeLogBuffer called with too large of a buffer

From: Anton Blanchard <anton@samba.org>

HvCall_writeLogBuffer called with too large of a buffer
parent 821e6ef6
......@@ -90,11 +90,11 @@ void HvCall_writeLogBuffer(const void *buffer, u64 bufLen)
struct HvLpBufferList bufList;
u64 bytesLeft = bufLen;
u64 leftThisPage;
u64 curPtr = virt_to_absolute( (unsigned long) buffer );
u64 curPtr = virt_to_absolute((unsigned long) buffer);
while (bytesLeft) {
bufList.addr = curPtr;
leftThisPage = ((curPtr & PAGE_MASK) + PAGE_SIZE) - curPtr;
if (leftThisPage > bytesLeft) {
......@@ -105,11 +105,11 @@ void HvCall_writeLogBuffer(const void *buffer, u64 bufLen)
bytesLeft -= leftThisPage;
}
curPtr = (curPtr & PAGE_MASK) + PAGE_SIZE;
}
HvCall2(HvCallBaseWriteLogBuffer,
virt_to_absolute((unsigned long)&bufList), bufLen);
HvCall2(HvCallBaseWriteLogBuffer,
virt_to_absolute((unsigned long) &bufList),
bufList.len);
curPtr = (curPtr & PAGE_MASK) + PAGE_SIZE;
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment