diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2021-02-02 10:40:20 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2021-02-02 10:40:20 -0800 |
commit | 7d36ccd4bd07825775b512f654566d3e89e9cfd0 (patch) | |
tree | 1014da872463862b14af3b195eadd271ad5ba550 /kernel | |
parent | 2e02677e961fd4b96d8cf106b5979e6a3cdb7362 (diff) | |
parent | d17405d52bacd14fe7fdbb10c0434934ea496914 (diff) |
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
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/dma/map_benchmark.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/kernel/dma/map_benchmark.c b/kernel/dma/map_benchmark.c index b1496e744c68..1b1b8ff875cb 100644 --- a/kernel/dma/map_benchmark.c +++ b/kernel/dma/map_benchmark.c @@ -147,8 +147,10 @@ static int do_map_benchmark(struct map_benchmark_data *map) atomic64_set(&map->sum_sq_unmap, 0); atomic64_set(&map->loops, 0); - for (i = 0; i < threads; i++) + for (i = 0; i < threads; i++) { + get_task_struct(tsk[i]); wake_up_process(tsk[i]); + } msleep_interruptible(map->bparam.seconds * 1000); @@ -183,6 +185,8 @@ static int do_map_benchmark(struct map_benchmark_data *map) } out: + for (i = 0; i < threads; i++) + put_task_struct(tsk[i]); put_device(map->dev); kfree(tsk); return ret; |