fixed a potential 0-pointer deref

svn path=/trunk/; revision=5975
This commit is contained in:
Vizzini 2003-09-04 06:47:37 +00:00
parent f0496db9c5
commit 0e0fac5636

View file

@ -503,7 +503,6 @@ VOID ProtocolBindAdapter(
*/ */
{ {
/* we get to ignore BindContext because we will never pend an operation with NDIS */ /* we get to ignore BindContext because we will never pend an operation with NDIS */
DbgPrint(("tcpip!ProtocolBindAdapter called\n"));
TI_DbgPrint(DEBUG_DATALINK, ("Called.\n")); TI_DbgPrint(DEBUG_DATALINK, ("Called.\n"));
*Status = LANRegisterAdapter(DeviceName); *Status = LANRegisterAdapter(DeviceName);
} }
@ -629,13 +628,13 @@ VOID BindAdapter(
Adapter->TDPackets = NULL; Adapter->TDPackets = NULL;
for (i = 0; i < 2; i++) { for (i = 0; i < 2; i++) {
Packet = AllocateTDPacket(Adapter); Packet = AllocateTDPacket(Adapter);
PC(Packet)->Context = Adapter->TDPackets;
Adapter->TDPackets = Packet;
if (!Packet) { if (!Packet) {
TI_DbgPrint(MIN_TRACE, ("Insufficient resources.\n")); TI_DbgPrint(MIN_TRACE, ("Insufficient resources.\n"));
FreeTDPackets(Adapter); FreeTDPackets(Adapter);
return; return;
} }
PC(Packet)->Context = Adapter->TDPackets;
Adapter->TDPackets = Packet;
} }
/* Bind the adapter to IP layer */ /* Bind the adapter to IP layer */
@ -761,6 +760,7 @@ NDIS_STATUS LANRegisterAdapter(
/* Initialize array with media IDs we support */ /* Initialize array with media IDs we support */
MediaArray[MEDIA_ETH] = NdisMedium802_3; MediaArray[MEDIA_ETH] = NdisMedium802_3;
TI_DbgPrint(DEBUG_DATALINK,("opening adapter %wZ\n", AdapterName));
/* Open the adapter. */ /* Open the adapter. */
NdisOpenAdapter(&NdisStatus, NdisOpenAdapter(&NdisStatus,
&OpenStatus, &OpenStatus,