Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
net: mgmt: Fix memory corruption in wait_on_iface
The net_mgmt subsystem offers a function which waits (blocks) until a specified net event occurs. An event callback is pushed to the stack, then added to the net_mgmt_event_callback list. If the event occurs, the net_mgmt thread calls the callback and deletes the callback from the list. However, if the event does not occur within the timeout specified when invoking mgmt_event_wait_call() the function will return, corrupting the callback structure the stack is reused. This PR fixes the issue by deleting the callback before exiting in case the event does not occur. Signed-off-by: Bjarki Arge Andreasen <[email protected]>
- Loading branch information