From: Al Viro Date: Sun, 22 Mar 2015 00:06:04 +0000 (-0400) Subject: blk_rq_map_user(): use import_single_range() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=8f7e885a4cc167f8b1931800fa1319772ae4b11d;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git blk_rq_map_user(): use import_single_range() Signed-off-by: Al Viro --- diff --git a/block/blk-map.c b/block/blk-map.c index b8d2725324a6..da310a105429 100644 --- a/block/blk-map.c +++ b/block/blk-map.c @@ -124,10 +124,10 @@ int blk_rq_map_user(struct request_queue *q, struct request *rq, { struct iovec iov; struct iov_iter i; + int ret = import_single_range(rq_data_dir(rq), ubuf, len, &iov, &i); - iov.iov_base = ubuf; - iov.iov_len = len; - iov_iter_init(&i, rq_data_dir(rq), &iov, 1, len); + if (unlikely(ret < 0)) + return ret; return blk_rq_map_user_iov(q, rq, map_data, &i, gfp_mask); }