提交 41ed16fa 编写于 作者: H Hugh Dickins 提交者: Linus Torvalds

[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: NHugh Dickins <hugh@veritas.com>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 6150c325
...@@ -2493,7 +2493,7 @@ sg_page_malloc(int rqSz, int lowDma, int *retSzp) ...@@ -2493,7 +2493,7 @@ sg_page_malloc(int rqSz, int lowDma, int *retSzp)
} }
if (resp) { if (resp) {
if (!capable(CAP_SYS_ADMIN) || !capable(CAP_SYS_RAWIO)) if (!capable(CAP_SYS_ADMIN) || !capable(CAP_SYS_RAWIO))
memset(resp, 0, resSz); memset(page_address(resp), 0, resSz);
if (retSzp) if (retSzp)
*retSzp = resSz; *retSzp = resSz;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册