diff options
Diffstat (limited to 'block/bsg.c')
-rw-r--r-- | block/bsg.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/block/bsg.c b/block/bsg.c index ff46addde5d8..73c78fd12cc1 100644 --- a/block/bsg.c +++ b/block/bsg.c | |||
@@ -270,8 +270,8 @@ bsg_map_hdr(struct bsg_device *bd, struct sg_io_v4 *hdr, fmode_t has_write_perm, | |||
270 | * map scatter-gather elements separately and string them to request | 270 | * map scatter-gather elements separately and string them to request |
271 | */ | 271 | */ |
272 | rq = blk_get_request(q, rw, GFP_KERNEL); | 272 | rq = blk_get_request(q, rw, GFP_KERNEL); |
273 | if (!rq) | 273 | if (IS_ERR(rq)) |
274 | return ERR_PTR(-ENOMEM); | 274 | return rq; |
275 | blk_rq_set_block_pc(rq); | 275 | blk_rq_set_block_pc(rq); |
276 | 276 | ||
277 | ret = blk_fill_sgv4_hdr_rq(q, rq, hdr, bd, has_write_perm); | 277 | ret = blk_fill_sgv4_hdr_rq(q, rq, hdr, bd, has_write_perm); |
@@ -285,8 +285,8 @@ bsg_map_hdr(struct bsg_device *bd, struct sg_io_v4 *hdr, fmode_t has_write_perm, | |||
285 | } | 285 | } |
286 | 286 | ||
287 | next_rq = blk_get_request(q, READ, GFP_KERNEL); | 287 | next_rq = blk_get_request(q, READ, GFP_KERNEL); |
288 | if (!next_rq) { | 288 | if (IS_ERR(next_rq)) { |
289 | ret = -ENOMEM; | 289 | ret = PTR_ERR(next_rq); |
290 | goto out; | 290 | goto out; |
291 | } | 291 | } |
292 | rq->next_rq = next_rq; | 292 | rq->next_rq = next_rq; |