Skip to content

Commit

Permalink
[PATCH] Fix sg_page_malloc() memset
Browse files Browse the repository at this point in the history
sg_page_malloc should clear the data buffer, not that extent of mem_map.

This fixes Jesper's sg_page_free "Bad page states"

Signed-off-by: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Hugh Dickins authored and Linus Torvalds committed Jan 9, 2006
1 parent 6150c32 commit 41ed16f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/scsi/sg.c
Original file line number Diff line number Diff line change
Expand Up @@ -2493,7 +2493,7 @@ sg_page_malloc(int rqSz, int lowDma, int *retSzp)
}
if (resp) {
if (!capable(CAP_SYS_ADMIN) || !capable(CAP_SYS_RAWIO))
memset(resp, 0, resSz);
memset(page_address(resp), 0, resSz);
if (retSzp)
*retSzp = resSz;
}
Expand Down

0 comments on commit 41ed16f

Please sign in to comment.