Skip to content

Commit

Permalink
[BLOCK] Clear sg entry before filling in blk_rq_map_sg()
Browse files Browse the repository at this point in the history
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: Jens Axboe <jens.axboe@oracle.com>
  • Loading branch information
Jens Axboe committed Oct 17, 2007
1 parent bdb0250 commit 60573b8
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions block/ll_rw_blk.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 60573b8

Please sign in to comment.