]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - block/bsg.c
Merge tag 'rdma-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland...
[karo-tx-linux.git] / block / bsg.c
index ff46addde5d8e0877d390901bb6a91bac591bb13..276e869e686cbbdb39112f19b163e353f0ddc3ef 100644 (file)
@@ -270,8 +270,8 @@ bsg_map_hdr(struct bsg_device *bd, struct sg_io_v4 *hdr, fmode_t has_write_perm,
         * map scatter-gather elements separately and string them to request
         */
        rq = blk_get_request(q, rw, GFP_KERNEL);
-       if (!rq)
-               return ERR_PTR(-ENOMEM);
+       if (IS_ERR(rq))
+               return rq;
        blk_rq_set_block_pc(rq);
 
        ret = blk_fill_sgv4_hdr_rq(q, rq, hdr, bd, has_write_perm);
@@ -285,8 +285,9 @@ bsg_map_hdr(struct bsg_device *bd, struct sg_io_v4 *hdr, fmode_t has_write_perm,
                }
 
                next_rq = blk_get_request(q, READ, GFP_KERNEL);
-               if (!next_rq) {
-                       ret = -ENOMEM;
+               if (IS_ERR(next_rq)) {
+                       ret = PTR_ERR(next_rq);
+                       next_rq = NULL;
                        goto out;
                }
                rq->next_rq = next_rq;