Author: cgutman
Date: Mon Oct 20 16:05:24 2008
New Revision: 36860
URL:
http://svn.reactos.org/svn/reactos?rev=36860&view=rev
Log:
- Check status for success
- Change a check
Modified:
branches/aicom-network-fixes/lib/drivers/ip/network/transmit.c
Modified: branches/aicom-network-fixes/lib/drivers/ip/network/transmit.c
URL:
http://svn.reactos.org/svn/reactos/branches/aicom-network-fixes/lib/drivers…
==============================================================================
--- branches/aicom-network-fixes/lib/drivers/ip/network/transmit.c [iso-8859-1]
(original)
+++ branches/aicom-network-fixes/lib/drivers/ip/network/transmit.c [iso-8859-1] Mon Oct 20
16:05:24 2008
@@ -28,6 +28,7 @@
*/
{
PIPFRAGMENT_CONTEXT IFC = (PIPFRAGMENT_CONTEXT)Context;
+ NTSTATUS Status;
TI_DbgPrint
(MAX_TRACE,
@@ -35,8 +36,14 @@
Context, NdisPacket, NdisStatus));
if (NT_SUCCESS(NdisStatus) && PrepareNextFragment(IFC)) {
- /* A fragment was prepared for transmission, so send it */
- IPSendFragment(IFC->NdisPacket, IFC->NCE, IFC);
+ /* A fragment was prepared for transmission, so send it */
+ Status = IPSendFragment(IFC->NdisPacket, IFC->NCE, IFC);
+ if (!NT_SUCCESS(Status))
+ {
+ FreeNdisPacket(IFC->NdisPacket);
+ IFC->Complete(IFC->Context, IFC->Datagram, Status);
+ exFreePool(IFC);
+ }
} else {
TI_DbgPrint(MAX_TRACE, ("Calling completion handler.\n"));
@@ -87,7 +94,7 @@
TI_DbgPrint(MAX_TRACE, ("Called. IFC (0x%X)\n", IFC));
- if (IFC->BytesLeft != 0) {
+ if (IFC->BytesLeft > 0) {
TI_DbgPrint(MAX_TRACE, ("Preparing 1 fragment.\n"));
@@ -203,7 +210,12 @@
/* Prepare next fragment for transmission and send it */
- PrepareNextFragment(IFC);
+ if (!PrepareNextFragment(IFC)) {
+ FreeNdisPacket(IFC->NdisPacket);
+ ExFreePool(IFC);
+ return NDIS_STATUS_FAILURE;
+ }
+
return IPSendFragment(IFC->NdisPacket, NCE, IFC);
}