OSDN Git Service

MIPS: VDSO: Prevent use of smp_processor_id()
[android-x86/kernel.git] / block / blk-map.c
index b8657fa..a8b4f52 100644 (file)
@@ -116,7 +116,10 @@ int blk_rq_map_user_iov(struct request_queue *q, struct request *rq,
        unsigned long align = q->dma_pad_mask | queue_dma_alignment(q);
        struct bio *bio = NULL;
        struct iov_iter i;
-       int ret;
+       int ret = -EINVAL;
+
+       if (!iter_is_iovec(iter))
+               goto fail;
 
        if (map_data)
                copy = true;
@@ -140,8 +143,9 @@ int blk_rq_map_user_iov(struct request_queue *q, struct request *rq,
 
 unmap_rq:
        __blk_rq_unmap_user(bio);
+fail:
        rq->bio = NULL;
-       return -EINVAL;
+       return ret;
 }
 EXPORT_SYMBOL(blk_rq_map_user_iov);