dma.c (e5451c8f8330e03ad3cfa16048b4daf961af434f) dma.c (6396bb221514d2876fd6dc0aa2a1f240d99b37bb)
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2014 Kevin Cernekee <cernekee@gmail.com>
7 */
8

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

89 if (!data)
90 goto out_good;
91
92 len /= sizeof(*data) * 3;
93 if (!len)
94 goto out_bad;
95
96 /* add a dummy (zero) entry at the end as a sentinel */
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2014 Kevin Cernekee <cernekee@gmail.com>
7 */
8

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

89 if (!data)
90 goto out_good;
91
92 len /= sizeof(*data) * 3;
93 if (!len)
94 goto out_bad;
95
96 /* add a dummy (zero) entry at the end as a sentinel */
97 bmips_dma_ranges = kzalloc(sizeof(struct bmips_dma_range) * (len + 1),
97 bmips_dma_ranges = kcalloc(len + 1, sizeof(struct bmips_dma_range),
98 GFP_KERNEL);
99 if (!bmips_dma_ranges)
100 goto out_bad;
101
102 for (r = bmips_dma_ranges; len; len--, r++) {
103 r->child_addr = be32_to_cpup(data++);
104 r->parent_addr = be32_to_cpup(data++);
105 r->size = be32_to_cpup(data++);

--- 12 unchanged lines hidden ---
98 GFP_KERNEL);
99 if (!bmips_dma_ranges)
100 goto out_bad;
101
102 for (r = bmips_dma_ranges; len; len--, r++) {
103 r->child_addr = be32_to_cpup(data++);
104 r->parent_addr = be32_to_cpup(data++);
105 r->size = be32_to_cpup(data++);

--- 12 unchanged lines hidden ---