Skip to content

Commit 8108b17

Browse files
pchelkin91gregkh
authored andcommitted
dma-mapping: benchmark: avoid needless copy_to_user if benchmark fails
[ Upstream commit f7c9cca ] 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]> Signed-off-by: Sasha Levin <[email protected]>
1 parent f7b2027 commit 8108b17

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

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)