diff options
-rw-r--r-- | net/hsr/hsr_netlink.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/net/hsr/hsr_netlink.c b/net/hsr/hsr_netlink.c index fbdf53f1d874..a2c7e4c0ac1e 100644 --- a/net/hsr/hsr_netlink.c +++ b/net/hsr/hsr_netlink.c | |||
@@ -37,13 +37,17 @@ static int hsr_newlink(struct net *src_net, struct net_device *dev, | |||
37 | struct net_device *link[2]; | 37 | struct net_device *link[2]; |
38 | unsigned char multicast_spec; | 38 | unsigned char multicast_spec; |
39 | 39 | ||
40 | if (!data) { | ||
41 | netdev_info(dev, "HSR: No slave devices specified\n"); | ||
42 | return -EINVAL; | ||
43 | } | ||
40 | if (!data[IFLA_HSR_SLAVE1]) { | 44 | if (!data[IFLA_HSR_SLAVE1]) { |
41 | netdev_info(dev, "IFLA_HSR_SLAVE1 missing!\n"); | 45 | netdev_info(dev, "HSR: Slave1 device not specified\n"); |
42 | return -EINVAL; | 46 | return -EINVAL; |
43 | } | 47 | } |
44 | link[0] = __dev_get_by_index(src_net, nla_get_u32(data[IFLA_HSR_SLAVE1])); | 48 | link[0] = __dev_get_by_index(src_net, nla_get_u32(data[IFLA_HSR_SLAVE1])); |
45 | if (!data[IFLA_HSR_SLAVE2]) { | 49 | if (!data[IFLA_HSR_SLAVE2]) { |
46 | netdev_info(dev, "IFLA_HSR_SLAVE2 missing!\n"); | 50 | netdev_info(dev, "HSR: Slave2 device not specified\n"); |
47 | return -EINVAL; | 51 | return -EINVAL; |
48 | } | 52 | } |
49 | link[1] = __dev_get_by_index(src_net, nla_get_u32(data[IFLA_HSR_SLAVE2])); | 53 | link[1] = __dev_get_by_index(src_net, nla_get_u32(data[IFLA_HSR_SLAVE2])); |