aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/xen-netfront.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/xen-netfront.c')
-rw-r--r--drivers/net/xen-netfront.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
index f821a97d7827..6febc053a37f 100644
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -1706,19 +1706,19 @@ static void xennet_destroy_queues(struct netfront_info *info)
1706} 1706}
1707 1707
1708static int xennet_create_queues(struct netfront_info *info, 1708static int xennet_create_queues(struct netfront_info *info,
1709 unsigned int num_queues) 1709 unsigned int *num_queues)
1710{ 1710{
1711 unsigned int i; 1711 unsigned int i;
1712 int ret; 1712 int ret;
1713 1713
1714 info->queues = kcalloc(num_queues, sizeof(struct netfront_queue), 1714 info->queues = kcalloc(*num_queues, sizeof(struct netfront_queue),
1715 GFP_KERNEL); 1715 GFP_KERNEL);
1716 if (!info->queues) 1716 if (!info->queues)
1717 return -ENOMEM; 1717 return -ENOMEM;
1718 1718
1719 rtnl_lock(); 1719 rtnl_lock();
1720 1720
1721 for (i = 0; i < num_queues; i++) { 1721 for (i = 0; i < *num_queues; i++) {
1722 struct netfront_queue *queue = &info->queues[i]; 1722 struct netfront_queue *queue = &info->queues[i];
1723 1723
1724 queue->id = i; 1724 queue->id = i;
@@ -1728,7 +1728,7 @@ static int xennet_create_queues(struct netfront_info *info,
1728 if (ret < 0) { 1728 if (ret < 0) {
1729 dev_warn(&info->netdev->dev, 1729 dev_warn(&info->netdev->dev,
1730 "only created %d queues\n", i); 1730 "only created %d queues\n", i);
1731 num_queues = i; 1731 *num_queues = i;
1732 break; 1732 break;
1733 } 1733 }
1734 1734
@@ -1738,11 +1738,11 @@ static int xennet_create_queues(struct netfront_info *info,
1738 napi_enable(&queue->napi); 1738 napi_enable(&queue->napi);
1739 } 1739 }
1740 1740
1741 netif_set_real_num_tx_queues(info->netdev, num_queues); 1741 netif_set_real_num_tx_queues(info->netdev, *num_queues);
1742 1742
1743 rtnl_unlock(); 1743 rtnl_unlock();
1744 1744
1745 if (num_queues == 0) { 1745 if (*num_queues == 0) {
1746 dev_err(&info->netdev->dev, "no queues\n"); 1746 dev_err(&info->netdev->dev, "no queues\n");
1747 return -EINVAL; 1747 return -EINVAL;
1748 } 1748 }
@@ -1788,7 +1788,7 @@ static int talk_to_netback(struct xenbus_device *dev,
1788 if (info->queues) 1788 if (info->queues)
1789 xennet_destroy_queues(info); 1789 xennet_destroy_queues(info);
1790 1790
1791 err = xennet_create_queues(info, num_queues); 1791 err = xennet_create_queues(info, &num_queues);
1792 if (err < 0) 1792 if (err < 0)
1793 goto destroy_ring; 1793 goto destroy_ring;
1794 1794