]> err.no Git - linux-2.6/commitdiff
block: make blk_rq_map_user() clear ->bio if it unmaps it
authorJens Axboe <jens.axboe@oracle.com>
Mon, 18 Feb 2008 12:51:56 +0000 (13:51 +0100)
committerJens Axboe <jens.axboe@oracle.com>
Tue, 19 Feb 2008 09:04:00 +0000 (10:04 +0100)
That way the interface is symmetric, and calling blk_rq_unmap_user()
on the request wont oops.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
block/blk-map.c

index 955d75c1a58fd634e3f168ec8d091c4c9e93a965..bc5ce60691c31244f84122800d8ae762285f3afa 100644 (file)
@@ -143,6 +143,7 @@ int blk_rq_map_user(struct request_queue *q, struct request *rq,
        return 0;
 unmap_rq:
        blk_rq_unmap_user(bio);
+       rq->bio = NULL;
        return ret;
 }
 EXPORT_SYMBOL(blk_rq_map_user);