]> git.baikalelectronics.ru Git - kernel.git/commit
staging: zsmalloc: Ensure handle is never 0 on success
authorOlav Haugan <ohaugan@codeaurora.org>
Fri, 22 Nov 2013 17:30:41 +0000 (09:30 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 25 Nov 2013 20:52:45 +0000 (12:52 -0800)
commitaa3b755e538d78b82653c33745471f17b0d29e5f
treebed05c365a16261e247c387dfa26a1e47bf6bfed
parent407098fe7bc77fedb0bc806f5eaad120fcdbf1a8
staging: zsmalloc: Ensure handle is never 0 on success

zsmalloc encodes a handle using the pfn and an object
index. On hardware platforms with physical memory starting
at 0x0 the pfn can be 0. This causes the encoded handle to be
0 and is incorrectly interpreted as an allocation failure.

This issue affects all current and future SoCs with physical
memory starting at 0x0. All MSM8974 SoCs which includes
Google Nexus 5 devices are affected.

To prevent this false error we ensure that the encoded handle
will not be 0 when allocation succeeds.

Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/zsmalloc/zsmalloc-main.c