Commit 8c69f52a authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

Staging: hv: osd: remove MemFree wrapper

Use the "real" kfree call instead of a wrapper function.

Cc: Hank Janssen <hjanssen@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 0a72f3cf
...@@ -311,7 +311,7 @@ VmbusChannelOpen( ...@@ -311,7 +311,7 @@ VmbusChannelOpen(
SpinlockRelease(gVmbusConnection.ChannelMsgLock); SpinlockRelease(gVmbusConnection.ChannelMsgLock);
WaitEventClose(openInfo->WaitEvent); WaitEventClose(openInfo->WaitEvent);
MemFree(openInfo); kfree(openInfo);
DPRINT_EXIT(VMBUS); DPRINT_EXIT(VMBUS);
...@@ -597,7 +597,7 @@ VmbusChannelEstablishGpadl( ...@@ -597,7 +597,7 @@ VmbusChannelEstablishGpadl(
SpinlockRelease(gVmbusConnection.ChannelMsgLock); SpinlockRelease(gVmbusConnection.ChannelMsgLock);
WaitEventClose(msgInfo->WaitEvent); WaitEventClose(msgInfo->WaitEvent);
MemFree(msgInfo); kfree(msgInfo);
DPRINT_EXIT(VMBUS); DPRINT_EXIT(VMBUS);
...@@ -658,7 +658,7 @@ VmbusChannelTeardownGpadl( ...@@ -658,7 +658,7 @@ VmbusChannelTeardownGpadl(
SpinlockRelease(gVmbusConnection.ChannelMsgLock); SpinlockRelease(gVmbusConnection.ChannelMsgLock);
WaitEventClose(info->WaitEvent); WaitEventClose(info->WaitEvent);
MemFree(info); kfree(info);
DPRINT_EXIT(VMBUS); DPRINT_EXIT(VMBUS);
...@@ -720,7 +720,7 @@ VmbusChannelClose( ...@@ -720,7 +720,7 @@ VmbusChannelClose(
PageFree(Channel->RingBufferPages, Channel->RingBufferPageCount); PageFree(Channel->RingBufferPages, Channel->RingBufferPageCount);
MemFree(info); kfree(info);
// If we are closing the channel during an error path in opening the channel, don't free the channel // If we are closing the channel during an error path in opening the channel, don't free the channel
// since the caller will free the channel // since the caller will free the channel
......
...@@ -152,7 +152,7 @@ VMBUS_CHANNEL* AllocVmbusChannel(void) ...@@ -152,7 +152,7 @@ VMBUS_CHANNEL* AllocVmbusChannel(void)
channel->InboundLock = SpinlockCreate(); channel->InboundLock = SpinlockCreate();
if (!channel->InboundLock) if (!channel->InboundLock)
{ {
MemFree(channel); kfree(channel);
return NULL; return NULL;
} }
...@@ -160,7 +160,7 @@ VMBUS_CHANNEL* AllocVmbusChannel(void) ...@@ -160,7 +160,7 @@ VMBUS_CHANNEL* AllocVmbusChannel(void)
if (!channel->PollTimer) if (!channel->PollTimer)
{ {
SpinlockClose(channel->InboundLock); SpinlockClose(channel->InboundLock);
MemFree(channel); kfree(channel);
return NULL; return NULL;
} }
...@@ -170,7 +170,7 @@ VMBUS_CHANNEL* AllocVmbusChannel(void) ...@@ -170,7 +170,7 @@ VMBUS_CHANNEL* AllocVmbusChannel(void)
{ {
TimerClose(channel->PollTimer); TimerClose(channel->PollTimer);
SpinlockClose(channel->InboundLock); SpinlockClose(channel->InboundLock);
MemFree(channel); kfree(channel);
return NULL; return NULL;
} }
...@@ -196,7 +196,7 @@ static inline void ReleaseVmbusChannel(void* Context) ...@@ -196,7 +196,7 @@ static inline void ReleaseVmbusChannel(void* Context)
WorkQueueClose(channel->ControlWQ); WorkQueueClose(channel->ControlWQ);
DPRINT_DBG(VMBUS, "channel released (%p)", channel); DPRINT_DBG(VMBUS, "channel released (%p)", channel);
MemFree(channel); kfree(channel);
DPRINT_EXIT(VMBUS); DPRINT_EXIT(VMBUS);
} }
...@@ -691,7 +691,7 @@ VmbusOnChannelMessage( ...@@ -691,7 +691,7 @@ VmbusOnChannelMessage(
{ {
DPRINT_ERR(VMBUS, "Received invalid channel message type %d size %d", hdr->MessageType, size); DPRINT_ERR(VMBUS, "Received invalid channel message type %d size %d", hdr->MessageType, size);
PrintBytes((unsigned char *)msg->u.Payload, size); PrintBytes((unsigned char *)msg->u.Payload, size);
MemFree(msg); kfree(msg);
return; return;
} }
...@@ -705,7 +705,7 @@ VmbusOnChannelMessage( ...@@ -705,7 +705,7 @@ VmbusOnChannelMessage(
} }
// Free the msg that was allocated in VmbusOnMsgDPC() // Free the msg that was allocated in VmbusOnMsgDPC()
MemFree(msg); kfree(msg);
DPRINT_EXIT(VMBUS); DPRINT_EXIT(VMBUS);
} }
...@@ -764,7 +764,7 @@ VmbusChannelRequestOffers( ...@@ -764,7 +764,7 @@ VmbusChannelRequestOffers(
if (msgInfo) if (msgInfo)
{ {
WaitEventClose(msgInfo->WaitEvent); WaitEventClose(msgInfo->WaitEvent);
MemFree(msgInfo); kfree(msgInfo);
} }
DPRINT_EXIT(VMBUS); DPRINT_EXIT(VMBUS);
......
...@@ -145,7 +145,7 @@ VmbusConnect( ...@@ -145,7 +145,7 @@ VmbusConnect(
WaitEventClose(msgInfo->WaitEvent); WaitEventClose(msgInfo->WaitEvent);
MemFree(msgInfo); kfree(msgInfo);
DPRINT_EXIT(VMBUS); DPRINT_EXIT(VMBUS);
return 0; return 0;
...@@ -175,7 +175,7 @@ VmbusConnect( ...@@ -175,7 +175,7 @@ VmbusConnect(
if (msgInfo->WaitEvent) if (msgInfo->WaitEvent)
WaitEventClose(msgInfo->WaitEvent); WaitEventClose(msgInfo->WaitEvent);
MemFree(msgInfo); kfree(msgInfo);
} }
DPRINT_EXIT(VMBUS); DPRINT_EXIT(VMBUS);
...@@ -233,7 +233,7 @@ VmbusDisconnect( ...@@ -233,7 +233,7 @@ VmbusDisconnect(
Cleanup: Cleanup:
if (msg) if (msg)
{ {
MemFree(msg); kfree(msg);
} }
DPRINT_EXIT(VMBUS); DPRINT_EXIT(VMBUS);
......
...@@ -361,7 +361,7 @@ HvCleanup ( ...@@ -361,7 +361,7 @@ HvCleanup (
if (gHvContext.SignalEventBuffer) if (gHvContext.SignalEventBuffer)
{ {
MemFree(gHvContext.SignalEventBuffer); kfree(gHvContext.SignalEventBuffer);
gHvContext.SignalEventBuffer = NULL; gHvContext.SignalEventBuffer = NULL;
gHvContext.SignalEventParam = NULL; gHvContext.SignalEventParam = NULL;
} }
...@@ -430,7 +430,7 @@ HvPostMessage( ...@@ -430,7 +430,7 @@ HvPostMessage(
status = HvDoHypercall(HvCallPostMessage, alignedMsg, 0) & 0xFFFF; status = HvDoHypercall(HvCallPostMessage, alignedMsg, 0) & 0xFFFF;
MemFree((void*)addr); kfree((void*)addr);
return status; return status;
} }
......
...@@ -139,7 +139,7 @@ static inline void FreeNetDevice(NETVSC_DEVICE *Device) ...@@ -139,7 +139,7 @@ static inline void FreeNetDevice(NETVSC_DEVICE *Device)
{ {
ASSERT(Device->RefCount == 0); ASSERT(Device->RefCount == 0);
Device->Device->Extension = NULL; Device->Device->Extension = NULL;
MemFree(Device); kfree(Device);
} }
...@@ -563,7 +563,7 @@ NetVscDestroyReceiveBuffer( ...@@ -563,7 +563,7 @@ NetVscDestroyReceiveBuffer(
if (NetDevice->ReceiveSections) if (NetDevice->ReceiveSections)
{ {
MemFree(NetDevice->ReceiveSections); kfree(NetDevice->ReceiveSections);
NetDevice->ReceiveSections = NULL; NetDevice->ReceiveSections = NULL;
NetDevice->ReceiveSectionCount = 0; NetDevice->ReceiveSectionCount = 0;
} }
...@@ -873,7 +873,7 @@ NetVscOnDeviceAdd( ...@@ -873,7 +873,7 @@ NetVscOnDeviceAdd(
{ {
entry = REMOVE_HEAD_LIST(&netDevice->ReceivePacketList); entry = REMOVE_HEAD_LIST(&netDevice->ReceivePacketList);
packet = CONTAINING_RECORD(entry, NETVSC_PACKET, ListEntry); packet = CONTAINING_RECORD(entry, NETVSC_PACKET, ListEntry);
MemFree(packet); kfree(packet);
} }
SpinlockClose(netDevice->ReceivePacketListLock); SpinlockClose(netDevice->ReceivePacketListLock);
...@@ -949,7 +949,7 @@ NetVscOnDeviceRemove( ...@@ -949,7 +949,7 @@ NetVscOnDeviceRemove(
entry = REMOVE_HEAD_LIST(&netDevice->ReceivePacketList); entry = REMOVE_HEAD_LIST(&netDevice->ReceivePacketList);
netvscPacket = CONTAINING_RECORD(entry, NETVSC_PACKET, ListEntry); netvscPacket = CONTAINING_RECORD(entry, NETVSC_PACKET, ListEntry);
MemFree(netvscPacket); kfree(netvscPacket);
} }
SpinlockClose(netDevice->ReceivePacketListLock); SpinlockClose(netDevice->ReceivePacketListLock);
...@@ -1456,7 +1456,7 @@ NetVscOnChannelCallback( ...@@ -1456,7 +1456,7 @@ NetVscOnChannelCallback(
// reset // reset
if (bufferlen > netPacketSize) if (bufferlen > netPacketSize)
{ {
MemFree(buffer); kfree(buffer);
buffer = packet; buffer = packet;
bufferlen = netPacketSize; bufferlen = netPacketSize;
...@@ -1469,7 +1469,7 @@ NetVscOnChannelCallback( ...@@ -1469,7 +1469,7 @@ NetVscOnChannelCallback(
// reset // reset
if (bufferlen > netPacketSize) if (bufferlen > netPacketSize)
{ {
MemFree(buffer); kfree(buffer);
buffer = packet; buffer = packet;
bufferlen = netPacketSize; bufferlen = netPacketSize;
......
...@@ -219,7 +219,7 @@ static inline RNDIS_DEVICE* GetRndisDevice(void) ...@@ -219,7 +219,7 @@ static inline RNDIS_DEVICE* GetRndisDevice(void)
device->RequestLock = SpinlockCreate(); device->RequestLock = SpinlockCreate();
if (!device->RequestLock) if (!device->RequestLock)
{ {
MemFree(device); kfree(device);
return NULL; return NULL;
} }
...@@ -233,7 +233,7 @@ static inline RNDIS_DEVICE* GetRndisDevice(void) ...@@ -233,7 +233,7 @@ static inline RNDIS_DEVICE* GetRndisDevice(void)
static inline void PutRndisDevice(RNDIS_DEVICE *Device) static inline void PutRndisDevice(RNDIS_DEVICE *Device)
{ {
SpinlockClose(Device->RequestLock); SpinlockClose(Device->RequestLock);
MemFree(Device); kfree(Device);
} }
static inline RNDIS_REQUEST* GetRndisRequest(RNDIS_DEVICE *Device, u32 MessageType, u32 MessageLength) static inline RNDIS_REQUEST* GetRndisRequest(RNDIS_DEVICE *Device, u32 MessageType, u32 MessageLength)
...@@ -251,7 +251,7 @@ static inline RNDIS_REQUEST* GetRndisRequest(RNDIS_DEVICE *Device, u32 MessageTy ...@@ -251,7 +251,7 @@ static inline RNDIS_REQUEST* GetRndisRequest(RNDIS_DEVICE *Device, u32 MessageTy
request->WaitEvent = WaitEventCreate(); request->WaitEvent = WaitEventCreate();
if (!request->WaitEvent) if (!request->WaitEvent)
{ {
MemFree(request); kfree(request);
return NULL; return NULL;
} }
...@@ -279,7 +279,7 @@ static inline void PutRndisRequest(RNDIS_DEVICE *Device, RNDIS_REQUEST *Request) ...@@ -279,7 +279,7 @@ static inline void PutRndisRequest(RNDIS_DEVICE *Device, RNDIS_REQUEST *Request)
SpinlockRelease(Device->RequestLock); SpinlockRelease(Device->RequestLock);
WaitEventClose(Request->WaitEvent); WaitEventClose(Request->WaitEvent);
MemFree(Request); kfree(Request);
} }
static inline void DumpRndisMessage(RNDIS_MESSAGE *RndisMessage) static inline void DumpRndisMessage(RNDIS_MESSAGE *RndisMessage)
......
...@@ -164,7 +164,7 @@ static inline STORVSC_DEVICE* AllocStorDevice(DEVICE_OBJECT *Device) ...@@ -164,7 +164,7 @@ static inline STORVSC_DEVICE* AllocStorDevice(DEVICE_OBJECT *Device)
static inline void FreeStorDevice(STORVSC_DEVICE *Device) static inline void FreeStorDevice(STORVSC_DEVICE *Device)
{ {
ASSERT(Device->RefCount == 0); ASSERT(Device->RefCount == 0);
MemFree(Device); kfree(Device);
} }
// Get the stordevice object iff exists and its refcount > 1 // Get the stordevice object iff exists and its refcount > 1
......
...@@ -121,7 +121,6 @@ extern void PageFree(void* page, unsigned int count); ...@@ -121,7 +121,6 @@ extern void PageFree(void* page, unsigned int count);
extern void* MemMapIO(unsigned long phys, unsigned long size); extern void* MemMapIO(unsigned long phys, unsigned long size);
extern void MemUnmapIO(void* virt); extern void MemUnmapIO(void* virt);
extern void MemFree(void* buf);
extern void MemoryFence(void); extern void MemoryFence(void);
extern HANDLE TimerCreate(PFN_TIMER_CALLBACK pfnTimerCB, void* context); extern HANDLE TimerCreate(PFN_TIMER_CALLBACK pfnTimerCB, void* context);
......
...@@ -189,11 +189,6 @@ void PageUnmapVirtualAddress(void* VirtAddr) ...@@ -189,11 +189,6 @@ void PageUnmapVirtualAddress(void* VirtAddr)
kunmap_atomic(VirtAddr, KM_IRQ0); kunmap_atomic(VirtAddr, KM_IRQ0);
} }
void MemFree(void* buf)
{
kfree(buf);
}
void *MemMapIO(unsigned long phys, unsigned long size) void *MemMapIO(unsigned long phys, unsigned long size)
{ {
#if X2V_LINUX #if X2V_LINUX
......
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