Skip to content

Commit f7c9cca

Browse files
pchelkin91Christoph Hellwig
authored and
Christoph Hellwig
committed
dma-mapping: benchmark: avoid needless copy_to_user if benchmark fails
If do_map_benchmark() has failed, there is nothing useful to copy back to userspace. Suggested-by: Barry Song <[email protected]> Signed-off-by: Fedor Pchelkin <[email protected]> Acked-by: Robin Murphy <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
1 parent bb9025f commit f7c9cca

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

kernel/dma/map_benchmark.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,9 @@ static long map_benchmark_ioctl(struct file *file, unsigned int cmd,
256256
* dma_mask changed by benchmark
257257
*/
258258
dma_set_mask(map->dev, old_dma_mask);
259+
260+
if (ret)
261+
return ret;
259262
break;
260263
default:
261264
return -EINVAL;

0 commit comments

Comments
 (0)