.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * Copyright (C) 2015 Robert Jarzmik <robert.jarzmik@free.fr> |
---|
3 | 4 | * |
---|
4 | 5 | * Scatterlist splitting helpers. |
---|
5 | | - * |
---|
6 | | - * This source code is licensed under the GNU General Public License, |
---|
7 | | - * Version 2. See the file COPYING for more details. |
---|
8 | 6 | */ |
---|
9 | 7 | |
---|
10 | 8 | #include <linux/scatterlist.h> |
---|
.. | .. |
---|
178 | 176 | * The order of these 3 calls is important and should be kept. |
---|
179 | 177 | */ |
---|
180 | 178 | sg_split_phys(splitters, nb_splits); |
---|
181 | | - ret = sg_calculate_split(in, in_mapped_nents, nb_splits, skip, |
---|
182 | | - split_sizes, splitters, true); |
---|
183 | | - if (ret < 0) |
---|
184 | | - goto err; |
---|
185 | | - sg_split_mapped(splitters, nb_splits); |
---|
| 179 | + if (in_mapped_nents) { |
---|
| 180 | + ret = sg_calculate_split(in, in_mapped_nents, nb_splits, skip, |
---|
| 181 | + split_sizes, splitters, true); |
---|
| 182 | + if (ret < 0) |
---|
| 183 | + goto err; |
---|
| 184 | + sg_split_mapped(splitters, nb_splits); |
---|
| 185 | + } |
---|
186 | 186 | |
---|
187 | 187 | for (i = 0; i < nb_splits; i++) { |
---|
188 | 188 | out[i] = splitters[i].out_sg; |
---|