From: Hugh Dickins Date: Mon, 9 Jan 2006 20:46:49 +0000 (+0000) Subject: [PATCH] Fix sg_page_malloc() memset X-Git-Tag: v2.6.16-rc1~665 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=41ed16fa47350661da01443b8241bf6ca8080fd7;p=linux-2.6 [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 Signed-off-by: Linus Torvalds --- diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c index 221e96e262..78aad9582b 100644 --- a/drivers/scsi/sg.c +++ b/drivers/scsi/sg.c @@ -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; }