Skip to content
/ linux Public
forked from torvalds/linux

Commit

Permalink
dma-mapping: benchmark: avoid needless copy_to_user if benchmark fails
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Fedor Pchelkin authored and Christoph Hellwig committed May 23, 2024
1 parent bb9025f commit f7c9cca
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions kernel/dma/map_benchmark.c
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,9 @@ static long map_benchmark_ioctl(struct file *file, unsigned int cmd,
* dma_mask changed by benchmark
*/
dma_set_mask(map->dev, old_dma_mask);

if (ret)
return ret;
break;
default:
return -EINVAL;
Expand Down

0 comments on commit f7c9cca

Please sign in to comment.