capsule.c (c25141062a82ae8bddced1b3ce2b57a1c0efabe0) capsule.c (6396bb221514d2876fd6dc0aa2a1f240d99b37bb)
1/*
2 * EFI capsule support.
3 *
4 * Copyright 2013 Intel Corporation; author Matt Fleming
5 *
6 * This file is part of the Linux kernel, and is made available under
7 * the terms of the GNU General Public License version 2.
8 */

--- 217 unchanged lines hidden (view full) ---

226
227 rv = efi_capsule_supported(guid, flags, imagesize, &reset_type);
228 if (rv)
229 return rv;
230
231 count = DIV_ROUND_UP(imagesize, PAGE_SIZE);
232 sg_count = sg_pages_num(count);
233
1/*
2 * EFI capsule support.
3 *
4 * Copyright 2013 Intel Corporation; author Matt Fleming
5 *
6 * This file is part of the Linux kernel, and is made available under
7 * the terms of the GNU General Public License version 2.
8 */

--- 217 unchanged lines hidden (view full) ---

226
227 rv = efi_capsule_supported(guid, flags, imagesize, &reset_type);
228 if (rv)
229 return rv;
230
231 count = DIV_ROUND_UP(imagesize, PAGE_SIZE);
232 sg_count = sg_pages_num(count);
233
234 sg_pages = kzalloc(sg_count * sizeof(*sg_pages), GFP_KERNEL);
234 sg_pages = kcalloc(sg_count, sizeof(*sg_pages), GFP_KERNEL);
235 if (!sg_pages)
236 return -ENOMEM;
237
238 for (i = 0; i < sg_count; i++) {
239 sg_pages[i] = alloc_page(GFP_KERNEL);
240 if (!sg_pages[i]) {
241 rv = -ENOMEM;
242 goto out;

--- 63 unchanged lines hidden ---
235 if (!sg_pages)
236 return -ENOMEM;
237
238 for (i = 0; i < sg_count; i++) {
239 sg_pages[i] = alloc_page(GFP_KERNEL);
240 if (!sg_pages[i]) {
241 rv = -ENOMEM;
242 goto out;

--- 63 unchanged lines hidden ---