[PATCH] fix SG_IO bio leak

This patch fixes bio leaks in SG_IO. rq->bio can be changed after io
completion, so we need to reset rq->bio before calling blk_rq_unmap_user()

http://marc.theaimsgroup.com/?l=linux-kernel&m=116570666807983&w=2

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>

authored by FUJITA Tomonori and committed by Jens Axboe 77d172ce 2b02a179

+3
+3
block/scsi_ioctl.c
··· 228 228 struct request *rq; 229 229 char sense[SCSI_SENSE_BUFFERSIZE]; 230 230 unsigned char cmd[BLK_MAX_CDB]; 231 + struct bio *bio; 231 232 232 233 if (hdr->interface_id != 'S') 233 234 return -EINVAL; ··· 309 308 if (ret) 310 309 goto out; 311 310 311 + bio = rq->bio; 312 312 rq->retries = 0; 313 313 314 314 start_time = jiffies; ··· 340 338 hdr->sb_len_wr = len; 341 339 } 342 340 341 + rq->bio = bio; 343 342 if (blk_rq_unmap_user(rq)) 344 343 ret = -EFAULT; 345 344