Skip to content

Commit

Permalink
usb: usb_dc_native_posix_adapt: Check correct size
Browse files Browse the repository at this point in the history
Fixes Coverity issues

Fixes zephyrproject-rtos#20842

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
  • Loading branch information
finikorg authored and nashif committed Nov 29, 2019
1 parent e4a9be9 commit 959b833
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/usb/device/usb_dc_native_posix_adapt.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,13 +211,13 @@ static void handle_usbip_submit(int connfd, struct usbip_header *hdr)

static void handle_usbip_unlink(int connfd, struct usbip_header *hdr)
{
struct usbip_unlink *req = &hdr->u.unlink;
u64_t setup_padding;
int read;

LOG_DBG("");

read = recv(connfd, req, sizeof(hdr->u), 0);
/* Need to read the whole structure */
read = recv(connfd, &hdr->u, sizeof(hdr->u), 0);
if (read != sizeof(hdr->u)) {
LOG_ERR("recv() failed: %s", strerror(errno));
return;
Expand Down

0 comments on commit 959b833

Please sign in to comment.