net: honour netif_set_real_num_tx_queues() retval
authorJiri Pirko <jiri@resnulli.us>
Fri, 20 Jul 2012 02:28:46 +0000 (02:28 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 20 Jul 2012 18:06:59 +0000 (11:06 -0700)
In netif_copy_real_num_queues() the return value of
netif_set_real_num_tx_queues() should be checked.

Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/netdevice.h

index ab0251d541ab8c8ccc31091edc8e2458746d3cf8..eb06e58bed0b2dc9c7e2d6a9b166d69380556e58 100644 (file)
@@ -2110,7 +2110,12 @@ static inline int netif_set_real_num_rx_queues(struct net_device *dev,
 static inline int netif_copy_real_num_queues(struct net_device *to_dev,
                                             const struct net_device *from_dev)
 {
-       netif_set_real_num_tx_queues(to_dev, from_dev->real_num_tx_queues);
+       int err;
+
+       err = netif_set_real_num_tx_queues(to_dev,
+                                          from_dev->real_num_tx_queues);
+       if (err)
+               return err;
 #ifdef CONFIG_RPS
        return netif_set_real_num_rx_queues(to_dev,
                                            from_dev->real_num_rx_queues);