Эх сурвалжийг харах

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 <jens.axboe@oracle.com>
Jens Axboe 17 жил өмнө
parent
commit
84e9e03c55
1 өөрчлөгдсөн 1 нэмэгдсэн , 0 устгасан
  1. 1 0
      block/blk-map.c

+ 1 - 0
block/blk-map.c

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