diff options
Diffstat (limited to 'drivers/block/virtio_blk.c')
-rw-r--r-- | drivers/block/virtio_blk.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c index 2edfb5cef4f2..53b81d59059b 100644 --- a/drivers/block/virtio_blk.c +++ b/drivers/block/virtio_blk.c | |||
@@ -90,10 +90,12 @@ static inline struct virtblk_req *virtblk_alloc_req(struct virtio_blk *vblk, | |||
90 | struct virtblk_req *vbr; | 90 | struct virtblk_req *vbr; |
91 | 91 | ||
92 | vbr = mempool_alloc(vblk->pool, gfp_mask); | 92 | vbr = mempool_alloc(vblk->pool, gfp_mask); |
93 | if (vbr && use_bio) | 93 | if (!vbr) |
94 | sg_init_table(vbr->sg, vblk->sg_elems); | 94 | return NULL; |
95 | 95 | ||
96 | vbr->vblk = vblk; | 96 | vbr->vblk = vblk; |
97 | if (use_bio) | ||
98 | sg_init_table(vbr->sg, vblk->sg_elems); | ||
97 | 99 | ||
98 | return vbr; | 100 | return vbr; |
99 | } | 101 | } |