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
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) {