Skip to content

Commit 9e895ac

Browse files
Niranjhana Njukkar
authored andcommitted
drivers: wifi: fix an unchecked return
Log error and return false if recv() has not received packet in the buffer. Signed-off-by: Niranjhana N <[email protected]>
1 parent 1645185 commit 9e895ac

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

drivers/wifi/winc1500/wifi_winc1500.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -822,8 +822,11 @@ static bool handle_socket_msg_recv(SOCKET sock,
822822
return false;
823823
}
824824

825-
recv(sock, sd->pkt_buf->data,
826-
CONFIG_WIFI_WINC1500_MAX_PACKET_SIZE, K_NO_WAIT);
825+
if (recv(sock, sd->pkt_buf->data,
826+
CONFIG_WIFI_WINC1500_MAX_PACKET_SIZE, K_NO_WAIT)) {
827+
LOG_ERR("Could not receive packet in the buffer");
828+
return false;
829+
}
827830

828831
return true;
829832
}

0 commit comments

Comments
 (0)