Use the "real" kzalloc call instead of a wrapper function.
Cc: Hank Janssen <hjanssen@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
// Allocate the ring buffer
out = PageAlloc((SendRingBufferSize + RecvRingBufferSize) >> PAGE_SHIFT);
- //out = MemAllocZeroed(sendRingBufferSize + recvRingBufferSize);
+ //out = kzalloc(sendRingBufferSize + recvRingBufferSize, GFP_KERNEL);
ASSERT(out);
ASSERT(((unsigned long)out & (PAGE_SIZE-1)) == 0);
{
// fill in the header
msgSize = sizeof(VMBUS_CHANNEL_MSGINFO) + sizeof(VMBUS_CHANNEL_GPADL_HEADER) + sizeof(GPA_RANGE) + pfnCount*sizeof(u64);
- msgHeader = MemAllocZeroed(msgSize);
+ msgHeader = kzalloc(msgSize, GFP_KERNEL);
INITIALIZE_LIST_HEAD(&msgHeader->SubMsgList);
msgHeader->MessageSize=msgSize;
}
msgSize = sizeof(VMBUS_CHANNEL_MSGINFO) + sizeof(VMBUS_CHANNEL_GPADL_BODY) + pfnCurr*sizeof(u64);
- msgBody = MemAllocZeroed(msgSize);
+ msgBody = kzalloc(msgSize, GFP_KERNEL);
ASSERT(msgBody);
msgBody->MessageSize = msgSize;
(*MessageCount)++;
{
// everything fits in a header
msgSize = sizeof(VMBUS_CHANNEL_MSGINFO) + sizeof(VMBUS_CHANNEL_GPADL_HEADER) + sizeof(GPA_RANGE) + pageCount*sizeof(u64);
- msgHeader = MemAllocZeroed(msgSize);
+ msgHeader = kzalloc(msgSize, GFP_KERNEL);
msgHeader->MessageSize=msgSize;
gpaHeader = (VMBUS_CHANNEL_GPADL_HEADER*)msgHeader->Msg;
goto Cleanup;
}
- msgInfo = (VMBUS_CHANNEL_MSGINFO*)MemAllocZeroed(sizeof(VMBUS_CHANNEL_MSGINFO) + sizeof(VMBUS_CHANNEL_INITIATE_CONTACT));
+ msgInfo = kzalloc(sizeof(VMBUS_CHANNEL_MSGINFO) + sizeof(VMBUS_CHANNEL_INITIATE_CONTACT), GFP_KERNEL);
if (msgInfo == NULL)
{
ret = -1;
if (gVmbusConnection.ConnectState != Connected)
return -1;
- msg = MemAllocZeroed(sizeof(VMBUS_CHANNEL_UNLOAD));
+ msg = kzalloc(sizeof(VMBUS_CHANNEL_UNLOAD), GFP_KERNEL);
msg->MessageType = ChannelMessageUnload;
{
NETVSC_DEVICE *netDevice;
- netDevice = MemAllocZeroed(sizeof(NETVSC_DEVICE));
+ netDevice = kzalloc(sizeof(NETVSC_DEVICE), GFP_KERNEL);
if (!netDevice)
return NULL;
for (i=0; i < NETVSC_RECEIVE_PACKETLIST_COUNT; i++)
{
- packet = MemAllocZeroed(sizeof(NETVSC_PACKET) + (NETVSC_RECEIVE_SG_COUNT* sizeof(PAGE_BUFFER)));
+ packet = kzalloc(sizeof(NETVSC_PACKET) + (NETVSC_RECEIVE_SG_COUNT* sizeof(PAGE_BUFFER)), GFP_KERNEL);
if (!packet)
{
DPRINT_DBG(NETVSC, "unable to allocate netvsc pkts for receive pool (wanted %d got %d)", NETVSC_RECEIVE_PACKETLIST_COUNT, i);
{
RNDIS_DEVICE *device;
- device = MemAllocZeroed(sizeof(RNDIS_DEVICE));
+ device = kzalloc(sizeof(RNDIS_DEVICE), GFP_KERNEL);
if (!device)
{
return NULL;
RNDIS_MESSAGE *rndisMessage;
RNDIS_SET_REQUEST *set;
- request = MemAllocZeroed(sizeof(RNDIS_REQUEST));
+ request = kzalloc(sizeof(RNDIS_REQUEST), GFP_KERNEL);
if (!request)
{
return NULL;
{
STORVSC_DEVICE *storDevice;
- storDevice = MemAllocZeroed(sizeof(STORVSC_DEVICE));
+ storDevice = kzalloc(sizeof(STORVSC_DEVICE), GFP_KERNEL);
if (!storDevice)
return NULL;
extern void* MemMapIO(unsigned long phys, unsigned long size);
extern void MemUnmapIO(void* virt);
-extern void* MemAllocZeroed(unsigned int size);
extern void* MemAllocAtomic(unsigned int size);
extern void MemFree(void* buf);
extern void MemoryFence(void);
kunmap_atomic(VirtAddr, KM_IRQ0);
}
-void* MemAllocZeroed(unsigned int size)
-{
- void *p = kmalloc(size, GFP_KERNEL);
- if (p) memset(p, 0, size);
- return p;
-}
-
void* MemAllocAtomic(unsigned int size)
{
return kmalloc(size, GFP_ATOMIC);