From 669de8c78a39a0548179b66e6e18a334874e833c Mon Sep 17 00:00:00 2001 From: Janusz Sobczak Date: Mon, 9 Aug 2010 13:22:04 +0200 Subject: [PATCH] gpu: pvr: Changed ReallocMem. A static analysis tool showed a possible defect in ReallocMem() - derefencing a null pointer. It was a false positive. This patch slightly modifies ReallocMem() to avoid this warning. Signed-off-by: Janusz Sobczak Signed-off-by: Imre Deak --- pvr/handle.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pvr/handle.c b/pvr/handle.c index bced654..f1c8f83 100644 --- a/pvr/handle.c +++ b/pvr/handle.c @@ -582,11 +582,10 @@ static enum PVRSRV_ERROR ReallocMem(void **ppvMem, void **phBlockAlloc, eError); return eError; } + if (ui32OldSize != 0) + OSMemCopy(pvNewMem, pvOldMem, ui32CopySize); } - if (ui32CopySize != 0) - OSMemCopy(pvNewMem, pvOldMem, ui32CopySize); - if (ui32OldSize != 0) OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, ui32OldSize, pvOldMem, hOldBlockAlloc); -- 2.39.5