arm-device.c (9095bf25ea08135a5b74875dd0e3eeaddc4218a0) | arm-device.c (6396bb221514d2876fd6dc0aa2a1f240d99b37bb) |
---|---|
1/* 2 * Copyright (c) 2015, Linaro Limited, Shannon Zhao 3 * 4 * This program is free software; you can redistribute it and/or modify it 5 * under the terms and conditions of the GNU General Public License, 6 * version 2, as published by the Free Software Foundation. 7 * 8 * This program is distributed in the hope it will be useful, but WITHOUT --- 56 unchanged lines hidden (view full) --- 65 .space = XENMAPSPACE_dev_mmio 66 }; 67 68 r = &resources[i]; 69 nr = DIV_ROUND_UP(resource_size(r), XEN_PAGE_SIZE); 70 if ((resource_type(r) != IORESOURCE_MEM) || (nr == 0)) 71 continue; 72 | 1/* 2 * Copyright (c) 2015, Linaro Limited, Shannon Zhao 3 * 4 * This program is free software; you can redistribute it and/or modify it 5 * under the terms and conditions of the GNU General Public License, 6 * version 2, as published by the Free Software Foundation. 7 * 8 * This program is distributed in the hope it will be useful, but WITHOUT --- 56 unchanged lines hidden (view full) --- 65 .space = XENMAPSPACE_dev_mmio 66 }; 67 68 r = &resources[i]; 69 nr = DIV_ROUND_UP(resource_size(r), XEN_PAGE_SIZE); 70 if ((resource_type(r) != IORESOURCE_MEM) || (nr == 0)) 71 continue; 72 |
73 gpfns = kzalloc(sizeof(xen_pfn_t) * nr, GFP_KERNEL); 74 idxs = kzalloc(sizeof(xen_ulong_t) * nr, GFP_KERNEL); 75 errs = kzalloc(sizeof(int) * nr, GFP_KERNEL); | 73 gpfns = kcalloc(nr, sizeof(xen_pfn_t), GFP_KERNEL); 74 idxs = kcalloc(nr, sizeof(xen_ulong_t), GFP_KERNEL); 75 errs = kcalloc(nr, sizeof(int), GFP_KERNEL); |
76 if (!gpfns || !idxs || !errs) { 77 kfree(gpfns); 78 kfree(idxs); 79 kfree(errs); 80 rc = -ENOMEM; 81 goto unmap; 82 } 83 --- 115 unchanged lines hidden --- | 76 if (!gpfns || !idxs || !errs) { 77 kfree(gpfns); 78 kfree(idxs); 79 kfree(errs); 80 rc = -ENOMEM; 81 goto unmap; 82 } 83 --- 115 unchanged lines hidden --- |