There was a reference counting problem in the TPC logic of net_clone(). net_clone() which is the common logic underlying dup() and dup2() for sockets. When net_clone() calls net_start_monitor() and net_start_monitor() returns a failure (because the underlying TCP connection) then net_clone() must back out the reference count on the structure. Problem noted by Pascal Speck and this implementation of the solution is based on his suggestion.

This commit is contained in:
Gregory Nutt
2017-10-19 11:09:23 -06:00
parent 5ef548677a
commit bc40403516
4 changed files with 54 additions and 18 deletions
+2 -2
View File
@@ -585,7 +585,7 @@ FAR struct mtd_dev_s *blockmtd_initialize(FAR const char *path, size_t offset,
* Teardown a previously created blockmtd device.
*
* Input Parameters:
* mtd - Pointer to the mtd.
* dev - Pointer to the mtd driver instance.
*
****************************************************************************/
@@ -655,7 +655,7 @@ FAR struct mtd_dev_s *filemtd_initialize(FAR const char *path, size_t offset,
* Teardown a previously created filemtd device.
*
* Input Parameters:
* mtd - Pointer to the mtd.
* dev - Pointer to the mtd driver instance.
*
****************************************************************************/