diff options
author | Joe Perches <joe@perches.com> | 2010-08-11 03:02:48 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-08-17 20:45:14 -0400 |
commit | baeb2ffab4e67bb9174e6166e070a9a8ec94b0f6 (patch) | |
tree | 08259e966cc0cacc58ed58a4865fe861cc255241 /drivers/net/wireless/rt2x00 | |
parent | 5a68d5ee000bb784c4856391b4861739c8bbd341 (diff) |
drivers/net: Convert unbounded kzalloc calls to kcalloc
These changes may be slightly safer in some instances.
There are other kzalloc calls with a multiply, but those
calls are typically "small fixed #" * sizeof(some pointer)"
and those are not converted.
Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Acked-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/wireless/rt2x00')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2400pci.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2500pci.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2500usb.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2800lib.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00debug.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00queue.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt61pci.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt73usb.c | 2 |
8 files changed, 9 insertions, 9 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2400pci.c b/drivers/net/wireless/rt2x00/rt2400pci.c index 5063e01410e5..8e3fbdf48889 100644 --- a/drivers/net/wireless/rt2x00/rt2400pci.c +++ b/drivers/net/wireless/rt2x00/rt2400pci.c | |||
@@ -1481,7 +1481,7 @@ static int rt2400pci_probe_hw_mode(struct rt2x00_dev *rt2x00dev) | |||
1481 | /* | 1481 | /* |
1482 | * Create channel information array | 1482 | * Create channel information array |
1483 | */ | 1483 | */ |
1484 | info = kzalloc(spec->num_channels * sizeof(*info), GFP_KERNEL); | 1484 | info = kcalloc(spec->num_channels, sizeof(*info), GFP_KERNEL); |
1485 | if (!info) | 1485 | if (!info) |
1486 | return -ENOMEM; | 1486 | return -ENOMEM; |
1487 | 1487 | ||
diff --git a/drivers/net/wireless/rt2x00/rt2500pci.c b/drivers/net/wireless/rt2x00/rt2500pci.c index c2a555d5376b..1d174e42f11e 100644 --- a/drivers/net/wireless/rt2x00/rt2500pci.c +++ b/drivers/net/wireless/rt2x00/rt2500pci.c | |||
@@ -1795,7 +1795,7 @@ static int rt2500pci_probe_hw_mode(struct rt2x00_dev *rt2x00dev) | |||
1795 | /* | 1795 | /* |
1796 | * Create channel information array | 1796 | * Create channel information array |
1797 | */ | 1797 | */ |
1798 | info = kzalloc(spec->num_channels * sizeof(*info), GFP_KERNEL); | 1798 | info = kcalloc(spec->num_channels, sizeof(*info), GFP_KERNEL); |
1799 | if (!info) | 1799 | if (!info) |
1800 | return -ENOMEM; | 1800 | return -ENOMEM; |
1801 | 1801 | ||
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.c b/drivers/net/wireless/rt2x00/rt2500usb.c index cdaf93f48263..8ddaae44d7fb 100644 --- a/drivers/net/wireless/rt2x00/rt2500usb.c +++ b/drivers/net/wireless/rt2x00/rt2500usb.c | |||
@@ -1698,7 +1698,7 @@ static int rt2500usb_probe_hw_mode(struct rt2x00_dev *rt2x00dev) | |||
1698 | /* | 1698 | /* |
1699 | * Create channel information array | 1699 | * Create channel information array |
1700 | */ | 1700 | */ |
1701 | info = kzalloc(spec->num_channels * sizeof(*info), GFP_KERNEL); | 1701 | info = kcalloc(spec->num_channels, sizeof(*info), GFP_KERNEL); |
1702 | if (!info) | 1702 | if (!info) |
1703 | return -ENOMEM; | 1703 | return -ENOMEM; |
1704 | 1704 | ||
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c index b66e0fd8f0fa..8c00fbda8664 100644 --- a/drivers/net/wireless/rt2x00/rt2800lib.c +++ b/drivers/net/wireless/rt2x00/rt2800lib.c | |||
@@ -2865,7 +2865,7 @@ int rt2800_probe_hw_mode(struct rt2x00_dev *rt2x00dev) | |||
2865 | /* | 2865 | /* |
2866 | * Create channel information array | 2866 | * Create channel information array |
2867 | */ | 2867 | */ |
2868 | info = kzalloc(spec->num_channels * sizeof(*info), GFP_KERNEL); | 2868 | info = kcalloc(spec->num_channels, sizeof(*info), GFP_KERNEL); |
2869 | if (!info) | 2869 | if (!info) |
2870 | return -ENOMEM; | 2870 | return -ENOMEM; |
2871 | 2871 | ||
diff --git a/drivers/net/wireless/rt2x00/rt2x00debug.c b/drivers/net/wireless/rt2x00/rt2x00debug.c index b0498e7e7aae..2d018ceffc54 100644 --- a/drivers/net/wireless/rt2x00/rt2x00debug.c +++ b/drivers/net/wireless/rt2x00/rt2x00debug.c | |||
@@ -333,7 +333,7 @@ static ssize_t rt2x00debug_read_queue_stats(struct file *file, | |||
333 | if (*offset) | 333 | if (*offset) |
334 | return 0; | 334 | return 0; |
335 | 335 | ||
336 | data = kzalloc(lines * MAX_LINE_LENGTH, GFP_KERNEL); | 336 | data = kcalloc(lines, MAX_LINE_LENGTH, GFP_KERNEL); |
337 | if (!data) | 337 | if (!data) |
338 | return -ENOMEM; | 338 | return -ENOMEM; |
339 | 339 | ||
diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.c b/drivers/net/wireless/rt2x00/rt2x00queue.c index a3401d301058..9c609be95083 100644 --- a/drivers/net/wireless/rt2x00/rt2x00queue.c +++ b/drivers/net/wireless/rt2x00/rt2x00queue.c | |||
@@ -755,7 +755,7 @@ static int rt2x00queue_alloc_entries(struct data_queue *queue, | |||
755 | * Allocate all queue entries. | 755 | * Allocate all queue entries. |
756 | */ | 756 | */ |
757 | entry_size = sizeof(*entries) + qdesc->priv_size; | 757 | entry_size = sizeof(*entries) + qdesc->priv_size; |
758 | entries = kzalloc(queue->limit * entry_size, GFP_KERNEL); | 758 | entries = kcalloc(queue->limit, entry_size, GFP_KERNEL); |
759 | if (!entries) | 759 | if (!entries) |
760 | return -ENOMEM; | 760 | return -ENOMEM; |
761 | 761 | ||
@@ -891,7 +891,7 @@ int rt2x00queue_allocate(struct rt2x00_dev *rt2x00dev) | |||
891 | */ | 891 | */ |
892 | rt2x00dev->data_queues = 2 + rt2x00dev->ops->tx_queues + req_atim; | 892 | rt2x00dev->data_queues = 2 + rt2x00dev->ops->tx_queues + req_atim; |
893 | 893 | ||
894 | queue = kzalloc(rt2x00dev->data_queues * sizeof(*queue), GFP_KERNEL); | 894 | queue = kcalloc(rt2x00dev->data_queues, sizeof(*queue), GFP_KERNEL); |
895 | if (!queue) { | 895 | if (!queue) { |
896 | ERROR(rt2x00dev, "Queue allocation failed.\n"); | 896 | ERROR(rt2x00dev, "Queue allocation failed.\n"); |
897 | return -ENOMEM; | 897 | return -ENOMEM; |
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c index e539c6cb636f..f226582dbc87 100644 --- a/drivers/net/wireless/rt2x00/rt61pci.c +++ b/drivers/net/wireless/rt2x00/rt61pci.c | |||
@@ -2654,7 +2654,7 @@ static int rt61pci_probe_hw_mode(struct rt2x00_dev *rt2x00dev) | |||
2654 | /* | 2654 | /* |
2655 | * Create channel information array | 2655 | * Create channel information array |
2656 | */ | 2656 | */ |
2657 | info = kzalloc(spec->num_channels * sizeof(*info), GFP_KERNEL); | 2657 | info = kcalloc(spec->num_channels, sizeof(*info), GFP_KERNEL); |
2658 | if (!info) | 2658 | if (!info) |
2659 | return -ENOMEM; | 2659 | return -ENOMEM; |
2660 | 2660 | ||
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c index aa9de18fd410..99985a218653 100644 --- a/drivers/net/wireless/rt2x00/rt73usb.c +++ b/drivers/net/wireless/rt2x00/rt73usb.c | |||
@@ -2084,7 +2084,7 @@ static int rt73usb_probe_hw_mode(struct rt2x00_dev *rt2x00dev) | |||
2084 | /* | 2084 | /* |
2085 | * Create channel information array | 2085 | * Create channel information array |
2086 | */ | 2086 | */ |
2087 | info = kzalloc(spec->num_channels * sizeof(*info), GFP_KERNEL); | 2087 | info = kcalloc(spec->num_channels, sizeof(*info), GFP_KERNEL); |
2088 | if (!info) | 2088 | if (!info) |
2089 | return -ENOMEM; | 2089 | return -ENOMEM; |
2090 | 2090 | ||