Commit 04166055 authored by Aleksander Morgado's avatar Aleksander Morgado Committed by David S. Miller

hso: fix rx parsing logic when skb allocation fails

If skb allocation fails once the IP header has been received, the rx state is
being set to WAIT_SYNC. The logic, though, shouldn't directly return, as the
buffer may contain a full packet, and therefore the WAIT_SYNC state needs to be
processed (resetting state to WAIT_IP, clearing rx_buf_size and re-initializing
rx_buf_missing).

So, just let the while loop continue so that in the next iteration the WAIT_SYNC
state cleanly stops the loop. The WAIT_SYNC processing will be done just after
that, only if the end of packet is flagged.
Signed-off-by: default avatarAleksander Morgado <aleksander@aleksander.es>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ba34e6d9
...@@ -914,7 +914,7 @@ static void packetizeRx(struct hso_net *odev, unsigned char *ip_pkt, ...@@ -914,7 +914,7 @@ static void packetizeRx(struct hso_net *odev, unsigned char *ip_pkt,
/* We got no receive buffer. */ /* We got no receive buffer. */
D1("could not allocate memory"); D1("could not allocate memory");
odev->rx_parse_state = WAIT_SYNC; odev->rx_parse_state = WAIT_SYNC;
return; continue;
} }
/* Copy what we got so far. make room for iphdr /* Copy what we got so far. make room for iphdr
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment