From 1348809807548dd481286a55a6677a9169fcd705 Mon Sep 17 00:00:00 2001 From: Joker2770 <1214220480@qq.com> Date: Fri, 25 Jun 2021 11:26:34 +0800 Subject: [PATCH] fix: Identical condition 'ret<0', second condition is always false. :bug: Signed-off-by: Joker2770 <1214220480@qq.com> --- drivers/block/disk/src/disk.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/block/disk/src/disk.c b/drivers/block/disk/src/disk.c index 756d3cc1..6c9681c6 100644 --- a/drivers/block/disk/src/disk.c +++ b/drivers/block/disk/src/disk.c @@ -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) {