summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid 'Digit' Turner <digit@google.com>2011-07-08 18:19:06 +0200
committerDavid 'Digit' Turner <digit@google.com>2011-07-08 18:19:06 +0200
commit5284bcffed2788b26399bec7150831eb8d9da74f (patch)
tree4a02ce01d70e45634ff55d496ed8d39364ee8eb2
parentc51920c82463b240e2be0430849837d6fdc5352e (diff)
parentd11b833201ae72265d52d606fa084841b44e9a65 (diff)
downloadvold-gingerbread.tar.gz
merge intel x86 patches into gingerbread branchandroid-cts-2.3_r12android-cts-2.3_r11android-cts-2.3_r10gingerbread
-rw-r--r--DirectVolume.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/DirectVolume.cpp b/DirectVolume.cpp
index 0ac1a0c9..a570a732 100644
--- a/DirectVolume.cpp
+++ b/DirectVolume.cpp
@@ -202,9 +202,13 @@ void DirectVolume::handlePartitionAdded(const char *devpath, NetlinkEvent *evt)
#ifdef PARTITION_DEBUG
SLOGD("Dv:partAdd: part_num = %d, minor = %d\n", part_num, minor);
#endif
- mPartMinors[part_num -1] = minor;
-
+ if (part_num >= MAX_PARTITIONS) {
+ SLOGE("Dv:partAdd: ignoring part_num = %d (max: %d)\n", part_num, MAX_PARTITIONS-1);
+ } else {
+ mPartMinors[part_num -1] = minor;
+ }
mPendingPartMap &= ~(1 << part_num);
+
if (!mPendingPartMap) {
#ifdef PARTITION_DEBUG
SLOGD("Dv:partAdd: Got all partitions - ready to rock!");