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

Signed-off-by: Joker2770 <1214220480@qq.com>
This commit is contained in:
Joker2770
2021-06-25 11:26:34 +08:00
parent eb72f78cf1
commit 1348809807

View File

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