diff --git a/drivers/mtd/cmdlinepart.c b/drivers/mtd/cmdlinepart.c
index edd17e0..3473af5 100644
--- a/drivers/mtd/cmdlinepart.c
+++ b/drivers/mtd/cmdlinepart.c
@@ -225,6 +225,53 @@ static inline void sort_partitons(struct mtd_partition *parts, int num_parts)
 	return;
 }
 
+enum partition_check_result {
+	PARTITION_GOOD,
+	PARTITION_OVERLAPPED,
+	PARTITION_HOLE,
+	PARTITION_TOO_MUCH_CONT,
+};
+
+/* The partitions have been sorted well by the @offset. */
+static inline int check_partitions(struct mtd_partition *parts, int num_parts)
+{
+	int i;
+	uint64_t offset = 0;
+	int offset_continuous_cnt = 0;
+
+	for (i = 0; i < num_parts; i++) {
+		if (parts[i].offset == OFFSET_CONTINUOUS) {
+			offset_continuous_cnt++;
+			continue;
+		}
+
+		/* find a hole. */
+		if (parts[i].offset > offset)
+			return PARTITION_HOLE;
+
+		/* find an overlapped partition. */
+		if (parts[i].offset < offset)
+			return PARTITION_OVERLAPPED;
+
+		offset += parts[i].size;
+	}
+
+	if (offset_continuous_cnt) {
+		/* We do not set partitions with the @offset in the cmdline. */
+		if (offset_continuous_cnt == num_parts)
+			return PARTITION_GOOD;
+
+		/* It's ok if there is only one OFFSET_CONTINUOUS partition. */
+		if (offset_continuous_cnt == 1)
+			return PARTITION_GOOD;
+
+		return PARTITION_TOO_MUCH_CONT;
+	}
+
+	/* We set with @offset for all the partitions in the cmdline. */
+	return PARTITION_GOOD;
+}
+
 /*
  * Parse the command line.
  */
@@ -238,6 +285,7 @@ static int mtdpart_setup_real(char *s)
 		struct mtd_partition *parts;
 		int mtd_id_len, num_parts;
 		char *p, *mtd_id;
+		enum partition_check_result ret;
 
 		mtd_id = s;
 
@@ -285,13 +333,37 @@ static int mtdpart_setup_real(char *s)
 		/* sort the partitions */
 		sort_partitons(parts, num_parts);
 
-		/* link into chain */
-		this_mtd->next = partitions;
-		partitions = this_mtd;
+		/* check the partitions */
+		ret = check_partitions(parts, num_parts);
+		switch (ret) {
+		case PARTITION_GOOD:
+			/* link into chain */
+			this_mtd->next = partitions;
+			partitions = this_mtd;
 
-		dbg(("mtdid=<%s> num_parts=<%d>\n",
-		     this_mtd->mtd_id, this_mtd->num_parts));
+			dbg(("mtdid=<%s> num_parts=<%d>\n",
+			     this_mtd->mtd_id, this_mtd->num_parts));
+			break;
 
+		case PARTITION_OVERLAPPED:
+			printk(KERN_ERR ERRP "%s:The partitions overlap,"
+				"please check the cmdline, and fix it.\n",
+				this_mtd->mtd_id);
+			break;
+
+		case PARTITION_HOLE:
+			printk(KERN_ERR ERRP "%s:There is a hole in the "
+				"partitions, please check the cmdline, "
+				"and fix it.\n",
+				this_mtd->mtd_id);
+			break;
+
+		case PARTITION_TOO_MUCH_CONT:
+			printk(KERN_ERR ERRP "%s:The offset is not right,"
+				"please check the cmdline, and fix it.\n",
+				this_mtd->mtd_id);
+			break;
+		}
 
 		/* EOS - we're done */
 		if (*s == 0)
