diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-01-06 20:22:09 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-01-06 20:22:09 -0500 |
commit | 9753dfe19a85e7e45a34a56f4cb2048bb4f50e27 (patch) | |
tree | c017a1b4a70b8447c71b01d8b320e071546b5c9d /net/netrom/nr_route.c | |
parent | edf7c8148ec40c0fd27c0ef3f688defcc65e3913 (diff) | |
parent | 9f42f126154786e6e76df513004800c8c633f020 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1958 commits)
net: pack skb_shared_info more efficiently
net_sched: red: split red_parms into parms and vars
net_sched: sfq: extend limits
cnic: Improve error recovery on bnx2x devices
cnic: Re-init dev->stats_addr after chip reset
net_sched: Bug in netem reordering
bna: fix sparse warnings/errors
bna: make ethtool_ops and strings const
xgmac: cleanups
net: make ethtool_ops const
vmxnet3" make ethtool ops const
xen-netback: make ops structs const
virtio_net: Pass gfp flags when allocating rx buffers.
ixgbe: FCoE: Add support for ndo_get_fcoe_hbainfo() call
netdev: FCoE: Add new ndo_get_fcoe_hbainfo() call
igb: reset PHY after recovering from PHY power down
igb: add basic runtime PM support
igb: Add support for byte queue limits.
e1000: cleanup CE4100 MDIO registers access
e1000: unmap ce4100_gbe_mdio_base_virt in e1000_remove
...
Diffstat (limited to 'net/netrom/nr_route.c')
-rw-r--r-- | net/netrom/nr_route.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/net/netrom/nr_route.c b/net/netrom/nr_route.c index 915a87ba23e1..2cf330162d7e 100644 --- a/net/netrom/nr_route.c +++ b/net/netrom/nr_route.c | |||
@@ -670,14 +670,17 @@ int nr_rt_ioctl(unsigned int cmd, void __user *arg) | |||
670 | case SIOCADDRT: | 670 | case SIOCADDRT: |
671 | if (copy_from_user(&nr_route, arg, sizeof(struct nr_route_struct))) | 671 | if (copy_from_user(&nr_route, arg, sizeof(struct nr_route_struct))) |
672 | return -EFAULT; | 672 | return -EFAULT; |
673 | if ((dev = nr_ax25_dev_get(nr_route.device)) == NULL) | 673 | if (nr_route.ndigis > AX25_MAX_DIGIS) |
674 | return -EINVAL; | 674 | return -EINVAL; |
675 | if (nr_route.ndigis < 0 || nr_route.ndigis > AX25_MAX_DIGIS) { | 675 | if ((dev = nr_ax25_dev_get(nr_route.device)) == NULL) |
676 | dev_put(dev); | ||
677 | return -EINVAL; | 676 | return -EINVAL; |
678 | } | ||
679 | switch (nr_route.type) { | 677 | switch (nr_route.type) { |
680 | case NETROM_NODE: | 678 | case NETROM_NODE: |
679 | if (strnlen(nr_route.mnemonic, 7) == 7) { | ||
680 | ret = -EINVAL; | ||
681 | break; | ||
682 | } | ||
683 | |||
681 | ret = nr_add_node(&nr_route.callsign, | 684 | ret = nr_add_node(&nr_route.callsign, |
682 | nr_route.mnemonic, | 685 | nr_route.mnemonic, |
683 | &nr_route.neighbour, | 686 | &nr_route.neighbour, |