!368 fix: Identical condition 'ret<0', second condition is always false. 🐛

Merge pull request !368 from Joker2770/master
This commit is contained in:
openharmony_ci 2021-06-25 07:13:33 +00:00 committed by Gitee
commit f4626985fd
1 changed files with 1 additions and 5 deletions

View File

@ -328,11 +328,7 @@ static INT32 DiskAddPart(los_disk *disk, UINT64 sectorStart, UINT64 sectorCount,
VnodeHold(); VnodeHold();
VnodeLookup(devName, &partDev, 0); VnodeLookup(devName, &partDev, 0);
if (ret < 0) {
VnodeDrop();
PRINT_ERR("DiskAddPart : find %s fail!\n", devName);
return VFS_ERROR;
}
part = DiskPartAllocate(partDev, sectorStart, sectorCount); part = DiskPartAllocate(partDev, sectorStart, sectorCount);
VnodeDrop(); VnodeDrop();
if (part == NULL) { if (part == NULL) {