OSDN Git Service

Vold: Correct part_num ignore logic
[android-x86/system-vold.git] / DirectVolume.cpp
index cfa1e0b..141f50b 100644 (file)
@@ -250,8 +250,8 @@ void DirectVolume::handlePartitionAdded(const char *devpath, NetlinkEvent *evt)
 #ifdef PARTITION_DEBUG
     SLOGD("Dv:partAdd: part_num = %d, minor = %d\n", part_num, minor);
 #endif
-    if (part_num >= MAX_PARTITIONS) {
-        SLOGE("Dv:partAdd: ignoring part_num = %d (max: %d)\n", part_num, MAX_PARTITIONS-1);
+    if (part_num > MAX_PARTITIONS) {
+        SLOGE("Dv:partAdd: ignoring part_num = %d (max: %d)\n", part_num, MAX_PARTITIONS);
     } else {
         if ((mPartMinors[part_num - 1] == -1) && mPendingPartCount)
             mPendingPartCount--;