]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
net: usb: mcs7830: fix non-DM ingress path
authorUri Mashiach <uri.mashiach@compulab.co.il>
Sun, 21 May 2017 14:00:52 +0000 (17:00 +0300)
committerMarek Vasut <marex@denx.de>
Sun, 21 May 2017 14:44:04 +0000 (16:44 +0200)
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>
drivers/usb/eth/mcs7830.c

index 9d6cf8ce7bda82c94bf84358811a6550d36d14eb..4abef5d5c88ef58fa7f10f547ec7411c22558e1a 100644 (file)
@@ -622,10 +622,12 @@ static int mcs7830_recv(struct eth_device *eth)
        int len;
 
        len = mcs7830_recv_common(ueth, buf);
-       if (len <= 0)
+       if (len >= 0) {
                net_process_received_packet(buf, len);
+               return 0;
+       }
 
-       return 0;
+       return len;
 }
 
 /*