summaryrefslogtreecommitdiff
path: root/drivers/net/usb/asix_devices.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2016-10-20 14:51:11 -0400
committerDavid S. Miller <davem@davemloft.net>2016-10-20 14:51:11 -0400
commit9e58c5dc4be31f8cf3ff62d96f91c97af6f9d58e (patch)
tree620fee35d81bca34bc7c117ba4bc65ab28f360b0 /drivers/net/usb/asix_devices.c
parent1a61a8f1776758acb5111785c8a1688394fa3a60 (diff)
parentb96f9afee4eb5229c80afa3d97ccf725fb1b89a6 (diff)
Merge branch 'MTU-core-range-checking-more'
Jarod Wilson says: ==================== net: use core MTU range checking everywhere This stack of patches should get absolutely everything in the kernel converted from doing their own MTU range checking to the core MTU range checking. This second spin includes alterations to hopefully fix all concerns raised with the first, as well as including some additional changes to drivers and infrastructure where I completely missed necessary updates. These have all been built through the 0-day build infrastructure via the (rebasing) master branch at https://github.com/jarodwilson/linux-muck, which at the time of the most recent compile across 147 configs, was based on net-next at commit 7b1536ef0aa0. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/usb/asix_devices.c')
-rw-r--r--drivers/net/usb/asix_devices.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/net/usb/asix_devices.c b/drivers/net/usb/asix_devices.c
index cce24950a0ab..7363cc5dd1bf 100644
--- a/drivers/net/usb/asix_devices.c
+++ b/drivers/net/usb/asix_devices.c
@@ -1026,9 +1026,6 @@ static int ax88178_change_mtu(struct net_device *net, int new_mtu)
netdev_dbg(dev->net, "ax88178_change_mtu() new_mtu=%d\n", new_mtu);
- if (new_mtu <= 0 || ll_mtu > 16384)
- return -EINVAL;
-
if ((ll_mtu % dev->maxpacket) == 0)
return -EDOM;
@@ -1081,6 +1078,7 @@ static int ax88178_bind(struct usbnet *dev, struct usb_interface *intf)
dev->net->netdev_ops = &ax88178_netdev_ops;
dev->net->ethtool_ops = &ax88178_ethtool_ops;
+ dev->net->max_mtu = 16384 - (dev->net->hard_header_len + 4);
/* Blink LEDS so users know driver saw dongle */
asix_sw_reset(dev, 0, 0);