Skip to content
This repository has been archived by the owner on Jul 7, 2021. It is now read-only.

Commit

Permalink
Merge branch 'overflow/neutrino-msm-hotdogb-4.14' of https://github.c…
Browse files Browse the repository at this point in the history
…om/0ctobot/neutrino-staging into neutrino-msm-hotdogb-4.14

* overflow/neutrino-msm-hotdogb-4.14: (22 commits)
  UPSTREAM: include/linux/slab.h: add kmalloc_array_node() and kcalloc_node()
  UPSTREAM: Convert virtio_console to struct_size
  UPSTREAM: Convert v4l2 event to struct_size
  UPSTREAM: mm: Use overflow helpers in kmalloc_array*()
  BACKPORT: mm: Use overflow helpers in kvmalloc()
  UPSTREAM: device: Use overflow helpers for devm_kmalloc()
  UPSTREAM: mm: Introduce kvcalloc()
  treewide: Use struct_size() for kmalloc()-family
  treewide: Use struct_size() for vmalloc()-family
  treewide: Use struct_size() for devm_kmalloc() and friends
  treewide: kmalloc() -> kmalloc_array()
  treewide: kzalloc() -> kcalloc()
  treewide: kzalloc_node() -> kcalloc_node()
  treewide: kvmalloc() -> kvmalloc_array()
  treewide: kvzalloc() -> kvcalloc()
  treewide: devm_kmalloc() -> devm_kmalloc_array()
  treewide: devm_kzalloc() -> devm_kcalloc()
  treewide: Use array_size() in vmalloc()
  treewide: Use array_size() in vzalloc()
  treewide: Use array_size() in vzalloc_node()
  treewide: Use array_size() in sock_kmalloc()
  treewide: Use array_size() in f2fs_kzalloc()

Signed-off-by: Adam W. Willis <return.of.octobot@gmail.com>
  • Loading branch information
0ctobot committed Aug 31, 2020
2 parents 2c03b62 + 01d5a5a commit ebafdf0
Show file tree
Hide file tree
Showing 1,433 changed files with 4,405 additions and 3,692 deletions.
4 changes: 2 additions & 2 deletions arch/arm/kernel/sys_oabi-compat.c
Expand Up @@ -287,7 +287,7 @@ asmlinkage long sys_oabi_epoll_wait(int epfd,
return -EINVAL;
if (!access_ok(VERIFY_WRITE, events, sizeof(*events) * maxevents))
return -EFAULT;
kbuf = kmalloc(sizeof(*kbuf) * maxevents, GFP_KERNEL);
kbuf = kmalloc_array(maxevents, sizeof(*kbuf), GFP_KERNEL);
if (!kbuf)
return -ENOMEM;
fs = get_fs();
Expand Down Expand Up @@ -328,7 +328,7 @@ asmlinkage long sys_oabi_semtimedop(int semid,
return -EINVAL;
if (!access_ok(VERIFY_READ, tsops, sizeof(*tsops) * nsops))
return -EFAULT;
sops = kmalloc(sizeof(*sops) * nsops, GFP_KERNEL);
sops = kmalloc_array(nsops, sizeof(*sops), GFP_KERNEL);
if (!sops)
return -ENOMEM;
err = 0;
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-footbridge/dc21285.c
Expand Up @@ -257,7 +257,7 @@ int __init dc21285_setup(int nr, struct pci_sys_data *sys)
if (nr || !footbridge_cfn_mode())
return 0;

res = kzalloc(sizeof(struct resource) * 2, GFP_KERNEL);
res = kcalloc(2, sizeof(struct resource), GFP_KERNEL);
if (!res) {
printk("out of memory for root bus resources");
return 0;
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-ixp4xx/common-pci.c
Expand Up @@ -421,7 +421,7 @@ int ixp4xx_setup(int nr, struct pci_sys_data *sys)
if (nr >= 1)
return 0;

res = kzalloc(sizeof(*res) * 2, GFP_KERNEL);
res = kcalloc(2, sizeof(*res), GFP_KERNEL);
if (res == NULL) {
/*
* If we're out of memory this early, something is wrong,
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-omap1/mcbsp.c
Expand Up @@ -389,7 +389,7 @@ static void omap_mcbsp_register_board_cfg(struct resource *res, int res_count,
{
int i;

omap_mcbsp_devices = kzalloc(size * sizeof(struct platform_device *),
omap_mcbsp_devices = kcalloc(size, sizeof(struct platform_device *),
GFP_KERNEL);
if (!omap_mcbsp_devices) {
printk(KERN_ERR "Could not register McBSP devices\n");
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-omap2/hsmmc.c
Expand Up @@ -37,7 +37,7 @@ static int __init omap_hsmmc_pdata_init(struct omap2_hsmmc_info *c,
{
char *hc_name;

hc_name = kzalloc(sizeof(char) * (HSMMC_NAME_LEN + 1), GFP_KERNEL);
hc_name = kzalloc(HSMMC_NAME_LEN + 1, GFP_KERNEL);
if (!hc_name) {
kfree(hc_name);
return -ENOMEM;
Expand Down
4 changes: 2 additions & 2 deletions arch/arm/mach-omap2/omap_device.c
Expand Up @@ -148,7 +148,7 @@ static int omap_device_build_from_dt(struct platform_device *pdev)
return -ENODEV;
}

hwmods = kzalloc(sizeof(struct omap_hwmod *) * oh_cnt, GFP_KERNEL);
hwmods = kcalloc(oh_cnt, sizeof(struct omap_hwmod *), GFP_KERNEL);
if (!hwmods) {
ret = -ENOMEM;
goto odbfd_exit;
Expand Down Expand Up @@ -468,7 +468,7 @@ struct omap_device *omap_device_alloc(struct platform_device *pdev,
}

/* Allocate resources memory to account for new resources */
res = kzalloc(sizeof(struct resource) * res_count, GFP_KERNEL);
res = kcalloc(res_count, sizeof(struct resource), GFP_KERNEL);
if (!res)
goto oda_exit3;

Expand Down
9 changes: 5 additions & 4 deletions arch/arm/mach-omap2/prm_common.c
Expand Up @@ -288,10 +288,11 @@ int omap_prcm_register_chain_handler(struct omap_prcm_irq_setup *irq_setup)

prcm_irq_setup = irq_setup;

prcm_irq_chips = kzalloc(sizeof(void *) * nr_regs, GFP_KERNEL);
prcm_irq_setup->saved_mask = kzalloc(sizeof(u32) * nr_regs, GFP_KERNEL);
prcm_irq_setup->priority_mask = kzalloc(sizeof(u32) * nr_regs,
GFP_KERNEL);
prcm_irq_chips = kcalloc(nr_regs, sizeof(void *), GFP_KERNEL);
prcm_irq_setup->saved_mask = kcalloc(nr_regs, sizeof(u32),
GFP_KERNEL);
prcm_irq_setup->priority_mask = kcalloc(nr_regs, sizeof(u32),
GFP_KERNEL);

if (!prcm_irq_chips || !prcm_irq_setup->saved_mask ||
!prcm_irq_setup->priority_mask)
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-vexpress/spc.c
Expand Up @@ -403,7 +403,7 @@ static int ve_spc_populate_opps(uint32_t cluster)
uint32_t data = 0, off, ret, idx;
struct ve_spc_opp *opps;

opps = kzalloc(sizeof(*opps) * MAX_OPPS, GFP_KERNEL);
opps = kcalloc(MAX_OPPS, sizeof(*opps), GFP_KERNEL);
if (!opps)
return -ENOMEM;

Expand Down
4 changes: 2 additions & 2 deletions arch/arm/mm/dma-mapping.c
Expand Up @@ -2400,8 +2400,8 @@ iommu_init_mapping(struct device *dev, struct dma_iommu_mapping *mapping)
}

mapping->bitmap_size = bitmap_size;
mapping->bitmaps = kzalloc(extensions * sizeof(unsigned long *),
GFP_KERNEL);
mapping->bitmaps = kcalloc(extensions, sizeof(unsigned long *),
GFP_KERNEL);

if (!mapping->bitmaps)
return -ENOMEM;
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mm/pgd.c
Expand Up @@ -20,7 +20,7 @@
#include "mm.h"

#ifdef CONFIG_ARM_LPAE
#define __pgd_alloc() kmalloc(PTRS_PER_PGD * sizeof(pgd_t), GFP_KERNEL)
#define __pgd_alloc() kmalloc_array(PTRS_PER_PGD, sizeof(pgd_t), GFP_KERNEL)
#define __pgd_free(pgd) kfree(pgd)
#else
#define __pgd_alloc() (pgd_t *)__get_free_pages(GFP_KERNEL, 2)
Expand Down
5 changes: 3 additions & 2 deletions arch/arm/plat-omap/dma.c
Expand Up @@ -1324,8 +1324,9 @@ static int omap_system_dma_probe(struct platform_device *pdev)


if (dma_omap2plus()) {
dma_linked_lch = kzalloc(sizeof(struct dma_link_info) *
dma_lch_count, GFP_KERNEL);
dma_linked_lch = kcalloc(dma_lch_count,
sizeof(struct dma_link_info),
GFP_KERNEL);
if (!dma_linked_lch) {
ret = -ENOMEM;
goto exit_dma_lch_fail;
Expand Down
5 changes: 3 additions & 2 deletions arch/arm/probes/kprobes/test-core.c
Expand Up @@ -823,8 +823,9 @@ static int coverage_start_fn(const struct decode_header *h, void *args)

static int coverage_start(const union decode_item *table)
{
coverage.base = kmalloc(MAX_COVERAGE_ENTRIES *
sizeof(struct coverage_entry), GFP_KERNEL);
coverage.base = kmalloc_array(MAX_COVERAGE_ENTRIES,
sizeof(struct coverage_entry),
GFP_KERNEL);
coverage.num_entries = 0;
coverage.nesting = 0;
return table_iter(table, coverage_start_fn, &coverage);
Expand Down
4 changes: 2 additions & 2 deletions arch/arm64/kernel/armv8_deprecated.c
Expand Up @@ -243,8 +243,8 @@ static void __init register_insn_emulation_sysctl(struct ctl_table *table)
struct insn_emulation *insn;
struct ctl_table *insns_sysctl, *sysctl;

insns_sysctl = kzalloc(sizeof(*sysctl) * (nr_insn_emulated + 1),
GFP_KERNEL);
insns_sysctl = kcalloc(nr_insn_emulated + 1, sizeof(*sysctl),
GFP_KERNEL);

raw_spin_lock_irqsave(&insn_emulation_lock, flags);
list_for_each_entry(insn, &insn_emulation, node) {
Expand Down
2 changes: 1 addition & 1 deletion arch/arm64/mm/context.c
Expand Up @@ -256,7 +256,7 @@ static int asids_init(void)
*/
WARN_ON(NUM_USER_ASIDS - 1 <= num_possible_cpus());
atomic64_set(&asid_generation, ASID_FIRST_VERSION);
asid_map = kzalloc(BITS_TO_LONGS(NUM_USER_ASIDS) * sizeof(*asid_map),
asid_map = kcalloc(BITS_TO_LONGS(NUM_USER_ASIDS), sizeof(*asid_map),
GFP_KERNEL);
if (!asid_map)
panic("Failed to allocate bitmap for %lu ASIDs\n",
Expand Down
2 changes: 1 addition & 1 deletion arch/blackfin/mm/isram-driver.c
Expand Up @@ -370,7 +370,7 @@ static __init int isram_test_init(void)
pr_info("INFO: testing %#x bytes (%p - %p)\n",
test_len, l1inst, l1inst + test_len);

sdram = kmalloc(test_len * 2, GFP_KERNEL);
sdram = kmalloc_array(test_len, 2, GFP_KERNEL);
if (!sdram) {
sram_free(l1inst);
pr_warning("SKIP: could not allocate sdram\n");
Expand Down
16 changes: 11 additions & 5 deletions arch/cris/arch-v32/drivers/cryptocop.c
Expand Up @@ -1533,7 +1533,9 @@ int cryptocop_new_session(cryptocop_session_id *sid, struct cryptocop_transform_
return -ENOMEM;
}

sess->tfrm_ctx = kmalloc(no_tfrms * sizeof(struct cryptocop_transform_ctx), alloc_flag);
sess->tfrm_ctx = kmalloc_array(no_tfrms,
sizeof(struct cryptocop_transform_ctx),
alloc_flag);
if (!sess->tfrm_ctx) {
DEBUG_API(printk("cryptocop_new_session, kmalloc cryptocop_transform_ctx\n"));
kfree(sess);
Expand Down Expand Up @@ -2698,7 +2700,7 @@ static int cryptocop_ioctl_process(struct inode *inode, struct file *filp, unsig
/* Map user pages for in and out data of the operation. */
noinpages = (((unsigned long int)(oper.indata + prev_ix) & ~PAGE_MASK) + oper.inlen - 1 - prev_ix + ~PAGE_MASK) >> PAGE_SHIFT;
DEBUG(printk("cryptocop_ioctl_process: noinpages=%d\n", noinpages));
inpages = kmalloc(noinpages * sizeof(struct page*), GFP_KERNEL);
inpages = kmalloc_array(noinpages, sizeof(struct page *), GFP_KERNEL);
if (!inpages){
DEBUG_API(printk("cryptocop_ioctl_process: kmalloc inpages\n"));
nooutpages = noinpages = 0;
Expand All @@ -2708,7 +2710,8 @@ static int cryptocop_ioctl_process(struct inode *inode, struct file *filp, unsig
if (oper.do_cipher){
nooutpages = (((unsigned long int)oper.cipher_outdata & ~PAGE_MASK) + oper.cipher_outlen - 1 + ~PAGE_MASK) >> PAGE_SHIFT;
DEBUG(printk("cryptocop_ioctl_process: nooutpages=%d\n", nooutpages));
outpages = kmalloc(nooutpages * sizeof(struct page*), GFP_KERNEL);
outpages = kmalloc_array(nooutpages, sizeof(struct page *),
GFP_KERNEL);
if (!outpages){
DEBUG_API(printk("cryptocop_ioctl_process: kmalloc outpages\n"));
nooutpages = noinpages = 0;
Expand Down Expand Up @@ -2752,8 +2755,11 @@ static int cryptocop_ioctl_process(struct inode *inode, struct file *filp, unsig

/* Add 6 to nooutpages to make room for possibly inserted buffers for storing digest and
* csum output and splits when units are (dis-)connected. */
cop->tfrm_op.indata = kmalloc((noinpages) * sizeof(struct iovec), GFP_KERNEL);
cop->tfrm_op.outdata = kmalloc((6 + nooutpages) * sizeof(struct iovec), GFP_KERNEL);
cop->tfrm_op.indata = kmalloc_array(noinpages, sizeof(struct iovec),
GFP_KERNEL);
cop->tfrm_op.outdata = kmalloc_array(6 + nooutpages,
sizeof(struct iovec),
GFP_KERNEL);
if (!cop->tfrm_op.indata || !cop->tfrm_op.outdata) {
DEBUG_API(printk("cryptocop_ioctl_process: kmalloc iovecs\n"));
err = -ENOMEM;
Expand Down
3 changes: 2 additions & 1 deletion arch/ia64/kernel/mca_drv.c
Expand Up @@ -350,7 +350,8 @@ init_record_index_pools(void)
/* - 3 - */
slidx_pool.max_idx = (rec_max_size/sect_min_size) * 2 + 1;
slidx_pool.buffer =
kmalloc(slidx_pool.max_idx * sizeof(slidx_list_t), GFP_KERNEL);
kmalloc_array(slidx_pool.max_idx, sizeof(slidx_list_t),
GFP_KERNEL);

return slidx_pool.buffer ? 0 : -ENOMEM;
}
Expand Down
6 changes: 3 additions & 3 deletions arch/ia64/kernel/topology.c
Expand Up @@ -85,7 +85,7 @@ static int __init topology_init(void)
}
#endif

sysfs_cpus = kzalloc(sizeof(struct ia64_cpu) * NR_CPUS, GFP_KERNEL);
sysfs_cpus = kcalloc(NR_CPUS, sizeof(struct ia64_cpu), GFP_KERNEL);
if (!sysfs_cpus)
panic("kzalloc in topology_init failed - NR_CPUS too big?");

Expand Down Expand Up @@ -319,8 +319,8 @@ static int cpu_cache_sysfs_init(unsigned int cpu)
return -1;
}

this_cache=kzalloc(sizeof(struct cache_info)*unique_caches,
GFP_KERNEL);
this_cache=kcalloc(unique_caches, sizeof(struct cache_info),
GFP_KERNEL);
if (this_cache == NULL)
return -ENOMEM;

Expand Down
5 changes: 3 additions & 2 deletions arch/ia64/mm/tlb.c
Expand Up @@ -430,8 +430,9 @@ int ia64_itr_entry(u64 target_mask, u64 va, u64 pte, u64 log_size)
int cpu = smp_processor_id();

if (!ia64_idtrs[cpu]) {
ia64_idtrs[cpu] = kmalloc(2 * IA64_TR_ALLOC_MAX *
sizeof (struct ia64_tr_entry), GFP_KERNEL);
ia64_idtrs[cpu] = kmalloc_array(2 * IA64_TR_ALLOC_MAX,
sizeof(struct ia64_tr_entry),
GFP_KERNEL);
if (!ia64_idtrs[cpu])
return -ENOMEM;
}
Expand Down
2 changes: 1 addition & 1 deletion arch/ia64/sn/kernel/io_common.c
Expand Up @@ -132,7 +132,7 @@ static s64 sn_device_fixup_war(u64 nasid, u64 widget, int device,
printk_once(KERN_WARNING
"PROM version < 4.50 -- implementing old PROM flush WAR\n");

war_list = kzalloc(DEV_PER_WIDGET * sizeof(*war_list), GFP_KERNEL);
war_list = kcalloc(DEV_PER_WIDGET, sizeof(*war_list), GFP_KERNEL);
BUG_ON(!war_list);

SAL_CALL_NOLOCK(isrv, SN_SAL_IOIF_GET_WIDGET_DMAFLUSH_LIST,
Expand Down
3 changes: 2 additions & 1 deletion arch/ia64/sn/kernel/irq.c
Expand Up @@ -474,7 +474,8 @@ void __init sn_irq_lh_init(void)
{
int i;

sn_irq_lh = kmalloc(sizeof(struct list_head *) * NR_IRQS, GFP_KERNEL);
sn_irq_lh = kmalloc_array(NR_IRQS, sizeof(struct list_head *),
GFP_KERNEL);
if (!sn_irq_lh)
panic("SN PCI INIT: Failed to allocate memory for PCI init\n");

Expand Down
2 changes: 1 addition & 1 deletion arch/ia64/sn/pci/pcibr/pcibr_provider.c
Expand Up @@ -184,7 +184,7 @@ pcibr_bus_fixup(struct pcibus_bussoft *prom_bussoft, struct pci_controller *cont
/* Setup the PMU ATE map */
soft->pbi_int_ate_resource.lowest_free_index = 0;
soft->pbi_int_ate_resource.ate =
kzalloc(soft->pbi_int_ate_size * sizeof(u64), GFP_KERNEL);
kcalloc(soft->pbi_int_ate_size, sizeof(u64), GFP_KERNEL);

if (!soft->pbi_int_ate_resource.ate) {
kfree(soft);
Expand Down
2 changes: 1 addition & 1 deletion arch/mips/alchemy/common/clock.c
Expand Up @@ -985,7 +985,7 @@ static int __init alchemy_clk_setup_imux(int ctype)
return -ENODEV;
}

a = kzalloc((sizeof(*a)) * 6, GFP_KERNEL);
a = kcalloc(6, sizeof(*a), GFP_KERNEL);
if (!a)
return -ENOMEM;

Expand Down
6 changes: 3 additions & 3 deletions arch/mips/alchemy/common/dbdma.c
Expand Up @@ -411,8 +411,8 @@ u32 au1xxx_dbdma_ring_alloc(u32 chanid, int entries)
* and if we try that first we are likely to not waste larger
* slabs of memory.
*/
desc_base = (u32)kmalloc(entries * sizeof(au1x_ddma_desc_t),
GFP_KERNEL|GFP_DMA);
desc_base = (u32) kmalloc_array(entries, sizeof(au1x_ddma_desc_t),
GFP_KERNEL|GFP_DMA);
if (desc_base == 0)
return 0;

Expand Down Expand Up @@ -1050,7 +1050,7 @@ static int __init dbdma_setup(unsigned int irq, dbdev_tab_t *idtable)
{
int ret;

dbdev_tab = kzalloc(sizeof(dbdev_tab_t) * DBDEV_TAB_SIZE, GFP_KERNEL);
dbdev_tab = kcalloc(DBDEV_TAB_SIZE, sizeof(dbdev_tab_t), GFP_KERNEL);
if (!dbdev_tab)
return -ENOMEM;

Expand Down
4 changes: 2 additions & 2 deletions arch/mips/alchemy/common/platform.c
Expand Up @@ -115,7 +115,7 @@ static void __init alchemy_setup_uarts(int ctype)
uartclk = clk_get_rate(clk);
clk_put(clk);

ports = kzalloc(s * (c + 1), GFP_KERNEL);
ports = kcalloc(s, (c + 1), GFP_KERNEL);
if (!ports) {
printk(KERN_INFO "Alchemy: no memory for UART data\n");
return;
Expand Down Expand Up @@ -198,7 +198,7 @@ static unsigned long alchemy_ehci_data[][2] __initdata = {

static int __init _new_usbres(struct resource **r, struct platform_device **d)
{
*r = kzalloc(sizeof(struct resource) * 2, GFP_KERNEL);
*r = kcalloc(2, sizeof(struct resource), GFP_KERNEL);
if (!*r)
return -ENOMEM;
*d = kzalloc(sizeof(struct platform_device), GFP_KERNEL);
Expand Down
4 changes: 2 additions & 2 deletions arch/mips/alchemy/devboards/platform.c
Expand Up @@ -103,7 +103,7 @@ int __init db1x_register_pcmcia_socket(phys_addr_t pcmcia_attr_start,
if (stschg_irq)
cnt++;

sr = kzalloc(sizeof(struct resource) * cnt, GFP_KERNEL);
sr = kcalloc(cnt, sizeof(struct resource), GFP_KERNEL);
if (!sr)
return -ENOMEM;

Expand Down Expand Up @@ -178,7 +178,7 @@ int __init db1x_register_norflash(unsigned long size, int width,
return -EINVAL;

ret = -ENOMEM;
parts = kzalloc(sizeof(struct mtd_partition) * 5, GFP_KERNEL);
parts = kcalloc(5, sizeof(struct mtd_partition), GFP_KERNEL);
if (!parts)
goto out;

Expand Down
2 changes: 1 addition & 1 deletion arch/mips/bmips/dma.c
Expand Up @@ -94,7 +94,7 @@ static int __init bmips_init_dma_ranges(void)
goto out_bad;

/* add a dummy (zero) entry at the end as a sentinel */
bmips_dma_ranges = kzalloc(sizeof(struct bmips_dma_range) * (len + 1),
bmips_dma_ranges = kcalloc(len + 1, sizeof(struct bmips_dma_range),
GFP_KERNEL);
if (!bmips_dma_ranges)
goto out_bad;
Expand Down
2 changes: 1 addition & 1 deletion arch/mips/txx9/rbtx4939/setup.c
Expand Up @@ -219,7 +219,7 @@ static int __init rbtx4939_led_probe(struct platform_device *pdev)
"nand-disk",
};

leds_data = kzalloc(sizeof(*leds_data) * RBTX4939_MAX_7SEGLEDS,
leds_data = kcalloc(RBTX4939_MAX_7SEGLEDS, sizeof(*leds_data),
GFP_KERNEL);
if (!leds_data)
return -ENOMEM;
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/kernel/rtasd.c
Expand Up @@ -548,7 +548,7 @@ static int __init rtas_event_scan_init(void)
rtas_error_log_max = rtas_get_error_log_max();
rtas_error_log_buffer_max = rtas_error_log_max + sizeof(int);

rtas_log_buf = vmalloc(rtas_error_log_buffer_max*LOG_NUMBER);
rtas_log_buf = vmalloc(array_size(LOG_NUMBER, rtas_error_log_buffer_max));
if (!rtas_log_buf) {
printk(KERN_ERR "rtasd: no memory\n");
return -ENOMEM;
Expand Down
4 changes: 2 additions & 2 deletions arch/powerpc/kernel/vdso.c
Expand Up @@ -789,7 +789,7 @@ static int __init vdso_init(void)

#ifdef CONFIG_VDSO32
/* Make sure pages are in the correct state */
vdso32_pagelist = kzalloc(sizeof(struct page *) * (vdso32_pages + 2),
vdso32_pagelist = kcalloc(vdso32_pages + 2, sizeof(struct page *),
GFP_KERNEL);
BUG_ON(vdso32_pagelist == NULL);
for (i = 0; i < vdso32_pages; i++) {
Expand All @@ -803,7 +803,7 @@ static int __init vdso_init(void)
#endif

#ifdef CONFIG_PPC64
vdso64_pagelist = kzalloc(sizeof(struct page *) * (vdso64_pages + 2),
vdso64_pagelist = kcalloc(vdso64_pages + 2, sizeof(struct page *),
GFP_KERNEL);
BUG_ON(vdso64_pagelist == NULL);
for (i = 0; i < vdso64_pages; i++) {
Expand Down

0 comments on commit ebafdf0

Please sign in to comment.