Skip to content

Commit 41ed16f

Browse files
Hugh DickinsLinus Torvalds
authored andcommitted
[PATCH] Fix sg_page_malloc() memset
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 <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 6150c32 commit 41ed16f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/scsi/sg.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2493,7 +2493,7 @@ sg_page_malloc(int rqSz, int lowDma, int *retSzp)
24932493
}
24942494
if (resp) {
24952495
if (!capable(CAP_SYS_ADMIN) || !capable(CAP_SYS_RAWIO))
2496-
memset(resp, 0, resSz);
2496+
memset(page_address(resp), 0, resSz);
24972497
if (retSzp)
24982498
*retSzp = resSz;
24992499
}

0 commit comments

Comments
 (0)