From f2dc307c48f6cec9fb332b07f5fec9dfe91feb44 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 16 Dec 2024 21:09:14 +0800 Subject: [PATCH] fix err Signed-off-by: unknown --- services/ptable_parse/ufs_ptable.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/ptable_parse/ufs_ptable.cpp b/services/ptable_parse/ufs_ptable.cpp index b4cee23a..e2aebcc0 100644 --- a/services/ptable_parse/ufs_ptable.cpp +++ b/services/ptable_parse/ufs_ptable.cpp @@ -47,6 +47,10 @@ uint32_t UfsPtable::GetPtableExtraOffset(void) // avoid u disk being recognized as a valid gpt lun device bool UfsPtable::IsUsbPath(const char* filePath) { + constexpr uint32_t minRemoveableStartIdx = 3; + if (lunIndex <= minRemoveableStartIdx) { + return false; + } const char* targetUsbString = "usb"; const char* targetXhciString = "xhci"; char linkBuf[READ_LINK_BUFFER_LENTH] = {0}; -- Gitee