From: Jens Axboe Date: Mon, 18 Feb 2008 12:51:56 +0000 (+0100) Subject: block: make blk_rq_map_user() clear ->bio if it unmaps it X-Git-Tag: v2.6.25-rc3~122^2~9 X-Git-Url: http://www.pilppa.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=84e9e03c55c2456799ab19f1d577e72f721fdd39;p=linux-2.6-omap-h63xx.git block: make blk_rq_map_user() clear ->bio if it unmaps it That way the interface is symmetric, and calling blk_rq_unmap_user() on the request wont oops. Signed-off-by: Jens Axboe --- diff --git a/block/blk-map.c b/block/blk-map.c index 955d75c1a58..bc5ce60691c 100644 --- a/block/blk-map.c +++ b/block/blk-map.c @@ -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);