usrsock_server: fix coverity for recvfrom handle
req->usockid may not be in a valid range when ret less than zero and not -EAGAIN. Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
This commit is contained in:
parent
3f927b63b7
commit
b30a389459
@ -642,7 +642,7 @@ static int usrsock_rpmsg_recvfrom_handler(FAR struct rpmsg_endpoint *ept,
|
||||
events, req->head.xid, totlen, iov[i].iov_len);
|
||||
}
|
||||
|
||||
if (retr >= 0 && events == 0)
|
||||
if (retr >= 0 && (ret > 0 || ret == -EAGAIN) && events == 0)
|
||||
{
|
||||
usrsock_rpmsg_poll_setup(&priv->pfds[req->usockid],
|
||||
priv->pfds[req->usockid].events | POLLIN);
|
||||
|
Loading…
Reference in New Issue
Block a user