drivers: wifi: simplelink: socket() should return non-zero fds

simplelink_socket() is not returning non-zero socket file descriptors
when it succeeds. This leads to socket() to always return socket fd 0,
even when the network processor returns a non-zero fd.

This commit fixes simplelink_socket() to return the correct socket fd
when it succeeds in getting one from the network processor.

Fixes #12650

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
This commit is contained in:
Vincent Wan 2019-01-15 10:18:29 -08:00 committed by Anas Nashif
commit f1619beab9

View file

@ -68,9 +68,12 @@ static int simplelink_socket(int family, int type, int proto)
if (retval < 0) {
retval = EPROTONOSUPPORT;
(void)sl_Close(sd);
goto exit;
}
}
retval = sd;
exit:
return _SlDrvSetErrno(retval);
}