Merge cherrypicks of [13083486, 13083716, 13083431, 13083573, 13083545, 13083736, 13083575, 13083776, 13083778, 13083757, 13083547, 13083530, 13083719, 13083780, 13083739, 13083549, 13083741, 13083742, 13083590, 13083593, 13083594, 13083816, 13083818, 13083820, 13083822, 13083824, 13083827, 13083828, 13083552, 13083760, 13083762, 13083764, 13083782, 13083784, 13083831, 13083787, 13083766, 13083835, 13083745, 13083877, 13083720, 13083489, 13083491, 13083274, 13083859, 13083897] into rvc-qpr1-release

Change-Id: I3e1cd62ccc6e6c005e8f8ab34b0b388cc25b5d7b
diff --git a/basicmbr.cc b/basicmbr.cc
index 8ac9789..e9ac5c5 100644
--- a/basicmbr.cc
+++ b/basicmbr.cc
@@ -292,7 +292,8 @@
          if (EbrLocations[i] == offset) { // already read this one; infinite logical partition loop!
             cerr << "Logical partition infinite loop detected! This is being corrected.\n";
             allOK = -1;
-            partNum -= 1;
+            if(partNum > 0) //don't go negative
+                partNum -= 1;
          } // if
       } // for
       EbrLocations[partNum] = offset;