Commit 3ce3026a0967350812b8cf246709b65384d2a336

Authored by Uri Mashiach
Committed by Marek Vasut
1 parent a375ff8e14

net: usb: mcs7830: fix non-DM ingress path

The mcs7830_recv() (non-DM) function discards good packets and tries to
process "bad" packets due to incorrect test condition.
Fix the condition and return the proper value as described in function
doc.

Signed-off-by: Uri Mashiach <uri.mashiach@compulab.co.il>
Acked-by: Igor Grinberg <grinberg@compulab.co.il>

Showing 1 changed file with 4 additions and 2 deletions Side-by-side Diff

drivers/usb/eth/mcs7830.c
... ... @@ -622,10 +622,12 @@
622 622 int len;
623 623  
624 624 len = mcs7830_recv_common(ueth, buf);
625   - if (len <= 0)
  625 + if (len >= 0) {
626 626 net_process_received_packet(buf, len);
  627 + return 0;
  628 + }
627 629  
628   - return 0;
  630 + return len;
629 631 }
630 632  
631 633 /*