fix: lookup new vnode may cause parent vnode freeing
Close #I3MYP4 Change-Id: I533f4bacaf7e6dd500f5ac3ce4f5343b3b885988
This commit is contained in:
parent
7ba0bfa800
commit
902a11de9a
|
@ -398,6 +398,7 @@ static int Step(char **currentDir, struct Vnode **currentVnode, uint32_t flags)
|
|||
goto STEP_FINISH;
|
||||
}
|
||||
|
||||
(*currentVnode)->useCount++;
|
||||
if (flags & V_DUMMY) {
|
||||
ret = ProcessVirtualVnode(*currentVnode, flags, &nextVnode);
|
||||
} else {
|
||||
|
@ -407,6 +408,7 @@ static int Step(char **currentDir, struct Vnode **currentVnode, uint32_t flags)
|
|||
ret = -ENOSYS;
|
||||
}
|
||||
}
|
||||
(*currentVnode)->useCount--;
|
||||
|
||||
if (ret == LOS_OK) {
|
||||
(void)PathCacheAlloc((*currentVnode), nextVnode, nextDir, len);
|
||||
|
|
Loading…
Reference in New Issue