Commit 8f7e885a4cc167f8b1931800fa1319772ae4b11d
1 parent
e272b89ff8
Exists in
ti-lsk-linux-4.1.y
and in
10 other branches
blk_rq_map_user(): use import_single_range()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Showing 1 changed file with 3 additions and 3 deletions Side-by-side Diff
block/blk-map.c
... | ... | @@ -124,10 +124,10 @@ |
124 | 124 | { |
125 | 125 | struct iovec iov; |
126 | 126 | struct iov_iter i; |
127 | + int ret = import_single_range(rq_data_dir(rq), ubuf, len, &iov, &i); | |
127 | 128 | |
128 | - iov.iov_base = ubuf; | |
129 | - iov.iov_len = len; | |
130 | - iov_iter_init(&i, rq_data_dir(rq), &iov, 1, len); | |
129 | + if (unlikely(ret < 0)) | |
130 | + return ret; | |
131 | 131 | |
132 | 132 | return blk_rq_map_user_iov(q, rq, map_data, &i, gfp_mask); |
133 | 133 | } |