In Ip6CleanService()it first cleaned some resources, then stop the timer .
While before the timer stopped it may try to access some already freed
data, which may generate an exception.
This patch updates the driver to stop the timer event before starting to
clean up the service data.
Cc: Wu Jiaxin <jiaxin.wu@intel.com>
Cc: Ye Ting <ting.ye@intel.com>
Cc: Subramanian Sriram <sriram-s@hpe.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com>
Reviewed-by: Sriram Subramanian <sriram-s@hpe.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
EFI_IPv6_ADDRESS AllNodes;\r
IP6_NEIGHBOR_ENTRY *NeighborCache;\r
\r
EFI_IPv6_ADDRESS AllNodes;\r
IP6_NEIGHBOR_ENTRY *NeighborCache;\r
\r
+ IpSb->State = IP6_SERVICE_DESTROY;\r
+\r
+ if (IpSb->Timer != NULL) {\r
+ gBS->SetTimer (IpSb->Timer, TimerCancel, 0);\r
+ gBS->CloseEvent (IpSb->Timer);\r
+\r
+ IpSb->Timer = NULL;\r
+ }\r
+\r
+ if (IpSb->FasterTimer != NULL) {\r
+ gBS->SetTimer (IpSb->FasterTimer, TimerCancel, 0);\r
+ gBS->CloseEvent (IpSb->FasterTimer);\r
+\r
+ IpSb->FasterTimer = NULL;\r
+ }\r
+\r
Ip6ConfigCleanInstance (&IpSb->Ip6ConfigInstance);\r
\r
if (!IpSb->LinkLocalDadFail) {\r
Ip6ConfigCleanInstance (&IpSb->Ip6ConfigInstance);\r
\r
if (!IpSb->LinkLocalDadFail) {\r
gBS->CloseEvent (IpSb->RecvRequest.MnpToken.Event);\r
}\r
\r
gBS->CloseEvent (IpSb->RecvRequest.MnpToken.Event);\r
}\r
\r
- if (IpSb->Timer != NULL) {\r
- gBS->SetTimer (IpSb->Timer, TimerCancel, 0);\r
- gBS->CloseEvent (IpSb->Timer);\r
-\r
- IpSb->Timer = NULL;\r
- }\r
-\r
- if (IpSb->FasterTimer != NULL) {\r
- gBS->SetTimer (IpSb->FasterTimer, TimerCancel, 0);\r
- gBS->CloseEvent (IpSb->FasterTimer);\r
-\r
- IpSb->FasterTimer = NULL;\r
- }\r
//\r
// Free the Neighbor Discovery resources\r
//\r
//\r
// Free the Neighbor Discovery resources\r
//\r
);\r
} else if (IsListEmpty (&IpSb->Children)) {\r
State = IpSb->State;\r
);\r
} else if (IsListEmpty (&IpSb->Children)) {\r
State = IpSb->State;\r
- IpSb->State = IP6_SERVICE_DESTROY;\r
-\r
Status = Ip6CleanService (IpSb);\r
if (EFI_ERROR (Status)) {\r
IpSb->State = State;\r
Status = Ip6CleanService (IpSb);\r
if (EFI_ERROR (Status)) {\r
IpSb->State = State;\r