Skip to content

Commit 7d36ccd

Browse files
committed
Merge tag 'dma-mapping-5.11-1' of git://git.infradead.org/users/hch/dma-mapping
Pull dma-mapping fix from Christoph Hellwig: "Fix a kernel crash in the new dma-mapping benchmark test (Barry Song)" * tag 'dma-mapping-5.11-1' of git://git.infradead.org/users/hch/dma-mapping: dma-mapping: benchmark: fix kernel crash when dma_map_single fails
2 parents 2e02677 + d17405d commit 7d36ccd

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

kernel/dma/map_benchmark.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,10 @@ static int do_map_benchmark(struct map_benchmark_data *map)
147147
atomic64_set(&map->sum_sq_unmap, 0);
148148
atomic64_set(&map->loops, 0);
149149

150-
for (i = 0; i < threads; i++)
150+
for (i = 0; i < threads; i++) {
151+
get_task_struct(tsk[i]);
151152
wake_up_process(tsk[i]);
153+
}
152154

153155
msleep_interruptible(map->bparam.seconds * 1000);
154156

@@ -183,6 +185,8 @@ static int do_map_benchmark(struct map_benchmark_data *map)
183185
}
184186

185187
out:
188+
for (i = 0; i < threads; i++)
189+
put_task_struct(tsk[i]);
186190
put_device(map->dev);
187191
kfree(tsk);
188192
return ret;

0 commit comments

Comments
 (0)