Skip to content

Commit 942b772

Browse files
committed
Nanostack: fix error code
Return NSAPI_ERROR_NO_MEMORY if socket->open() fails
1 parent 8f7024a commit 942b772

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

features/nanostack/nanostack-interface/Nanostack.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -552,8 +552,8 @@ nsapi_error_t Nanostack::socket_open(void **handle, nsapi_protocol_t protocol)
552552
}
553553
if (!socket->open()) {
554554
delete socket;
555-
tr_debug("socket_open() ret=%i", NSAPI_ERROR_DEVICE_ERROR);
556-
return NSAPI_ERROR_DEVICE_ERROR;
555+
tr_debug("socket_open() ret=%i", NSAPI_ERROR_NO_MEMORY);
556+
return NSAPI_ERROR_NO_MEMORY;
557557
}
558558
*handle = (void*)socket;
559559

0 commit comments

Comments
 (0)