summaryrefslogtreecommitdiff
path: root/drivers/usb/eth/mcs7830.c
diff options
context:
space:
mode:
authorUri Mashiach <uri.mashiach@compulab.co.il>2017-05-21 17:00:52 +0300
committerMarek Vasut <marex@denx.de>2017-05-21 16:44:04 +0200
commit3ce3026a0967350812b8cf246709b65384d2a336 (patch)
tree24a60f9e65467506d616fb22f2f5effe05e388f4 /drivers/usb/eth/mcs7830.c
parenta375ff8e14bea0a5cbfff99d6456aa8d9a3320ab (diff)
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>
Diffstat (limited to 'drivers/usb/eth/mcs7830.c')
-rw-r--r--drivers/usb/eth/mcs7830.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/usb/eth/mcs7830.c b/drivers/usb/eth/mcs7830.c
index 9d6cf8ce7b..4abef5d5c8 100644
--- a/drivers/usb/eth/mcs7830.c
+++ b/drivers/usb/eth/mcs7830.c
@@ -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;
}
/*