]> git.baikalelectronics.ru Git - kernel.git/commit
fix mm/util.c:krealloc()
authorAdrian Bunk <bunk@kernel.org>
Thu, 15 Nov 2007 01:00:01 +0000 (17:00 -0800)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Thu, 15 Nov 2007 02:45:41 +0000 (18:45 -0800)
commit20ed3f377463d2ce4571e420dd44ad8fe7d22ac7
tree5aeb6f2a2e62e36a8410ef725ac76fa69ab6a182
parent917534be995f0562524f14d5f83e052e7d118d38
fix mm/util.c:krealloc()

Commit b17b74e3dbd451d145e632d6204c062c7902cf6b added one NULL check for
"p" in krealloc(), but that doesn't seem to be enough since there
doesn't seem to be any guarantee that memcpy(ret, NULL, 0) works
(spotted by the Coverity checker).

For making it clearer what happens this patch also removes the pointless
min().

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Acked-by: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/util.c