提交 60573b87 编写于 作者: J Jens Axboe

[BLOCK] Clear sg entry before filling in blk_rq_map_sg()

The memset() of the sg entry was originally removed, because it could
overwrite a chain pointer. But it's quite OK to memset() it when we know
it's a valid entry, since it can't contain a chain pointer.
Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
上级 bdb02504
......@@ -1352,6 +1352,7 @@ int blk_rq_map_sg(struct request_queue *q, struct request *rq,
sg = next_sg;
next_sg = sg_next(sg);
memset(sg, 0, sizeof(*sg));
sg->page = bvec->bv_page;
sg->length = nbytes;
sg->offset = bvec->bv_offset;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册