Fix memory leak check and interity error check.
Delete redundant judgments. Close #I3P10Y and #I3QNLT Change-Id: I94ff34099bc39345ef5490f185f70c4b87bfd415
This commit is contained in:
parent
748a827560
commit
eac4a04153
|
@ -130,10 +130,6 @@ UINT32 LOS_MemboxInit(VOID *pool, UINT32 poolSize, UINT32 blkSize)
|
|||
|
||||
MEMBOX_LOCK(intSave);
|
||||
boxInfo->uwBlkSize = LOS_MEMBOX_ALIGNED(blkSize + OS_MEMBOX_NODE_HEAD_SIZE);
|
||||
if (boxInfo->uwBlkSize == 0) {
|
||||
MEMBOX_UNLOCK(intSave);
|
||||
return LOS_NOK;
|
||||
}
|
||||
boxInfo->uwBlkNum = (poolSize - sizeof(LOS_MEMBOX_INFO)) / boxInfo->uwBlkSize;
|
||||
boxInfo->uwBlkCnt = 0;
|
||||
if (boxInfo->uwBlkNum == 0) {
|
||||
|
|
|
@ -964,10 +964,6 @@ STATIC INLINE VOID *OsMemAlloc(struct OsMemPoolHead *pool, UINT32 size, UINT32 i
|
|||
#endif
|
||||
|
||||
UINT32 allocSize = OS_MEM_ALIGN(size + OS_MEM_NODE_HEAD_SIZE, OS_MEM_ALIGN_SIZE);
|
||||
if (allocSize == 0) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#if OS_MEM_EXPAND_ENABLE
|
||||
retry:
|
||||
#endif
|
||||
|
@ -1558,13 +1554,13 @@ STATIC INLINE VOID OsMemMagicCheckPrint(struct OsMemNodeHead **tmpNode)
|
|||
|
||||
STATIC UINT32 OsMemAddrValidCheckPrint(const VOID *pool, struct OsMemFreeNodeHead **tmpNode)
|
||||
{
|
||||
if (!OsMemAddrValidCheck(pool, (*tmpNode)->prev)) {
|
||||
if (((*tmpNode)->prev != NULL) && !OsMemAddrValidCheck(pool, (*tmpNode)->prev)) {
|
||||
PRINT_ERR("[%s], %d, memory check error!\n"
|
||||
" freeNode.prev: 0x%x is out of legal mem range\n",
|
||||
__FUNCTION__, __LINE__, (*tmpNode)->prev);
|
||||
return LOS_NOK;
|
||||
}
|
||||
if (!OsMemAddrValidCheck(pool, (*tmpNode)->next)) {
|
||||
if (((*tmpNode)->next != NULL) && !OsMemAddrValidCheck(pool, (*tmpNode)->next)) {
|
||||
PRINT_ERR("[%s], %d, memory check error!\n"
|
||||
" freeNode.next: 0x%x is out of legal mem range\n",
|
||||
__FUNCTION__, __LINE__, (*tmpNode)->next);
|
||||
|
|
Loading…
Reference in New Issue