Commit 7d36ccd4 authored by Linus Torvalds's avatar Linus Torvalds

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
parents 2e02677e d17405d5
...@@ -147,8 +147,10 @@ static int do_map_benchmark(struct map_benchmark_data *map) ...@@ -147,8 +147,10 @@ static int do_map_benchmark(struct map_benchmark_data *map)
atomic64_set(&map->sum_sq_unmap, 0); atomic64_set(&map->sum_sq_unmap, 0);
atomic64_set(&map->loops, 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]); wake_up_process(tsk[i]);
}
msleep_interruptible(map->bparam.seconds * 1000); msleep_interruptible(map->bparam.seconds * 1000);
...@@ -183,6 +185,8 @@ static int do_map_benchmark(struct map_benchmark_data *map) ...@@ -183,6 +185,8 @@ static int do_map_benchmark(struct map_benchmark_data *map)
} }
out: out:
for (i = 0; i < threads; i++)
put_task_struct(tsk[i]);
put_device(map->dev); put_device(map->dev);
kfree(tsk); kfree(tsk);
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment