From patchwork Mon Dec 17 00:59:29 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christopher Cordahi X-Patchwork-Id: 206758 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:4978:20e::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id C26262C00A6 for ; Mon, 17 Dec 2012 12:01:18 +1100 (EST) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TkP3a-0006Av-32; Mon, 17 Dec 2012 00:59:46 +0000 Received: from mail-ia0-f177.google.com ([209.85.210.177]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TkP3W-0006AZ-U2 for linux-mtd@lists.infradead.org; Mon, 17 Dec 2012 00:59:43 +0000 Received: by mail-ia0-f177.google.com with SMTP id u21so4774628ial.36 for ; Sun, 16 Dec 2012 16:59:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nanometrics.ca; s=google; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :in-reply-to:references; bh=cZgRIqfatNMwlJuxvhgJHR78dQ27Y0KAdZWz9rxBD6I=; b=i6DYaE6LI+o1RP4L6baHhqEJbTvyJOeNnuPCPyqBCR9ePhoLb1V5H37yIyIR/yjUy5 JtcSG1/txthObCo7z7qvlufAX7c2IGtppR0BLyETiVErcyZuDMWSCUbey8szg6kwWhDe 5TScTaLzJ0eHq4vanZhryvzQdU+InWTcGOols= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :in-reply-to:references:x-gm-message-state; bh=cZgRIqfatNMwlJuxvhgJHR78dQ27Y0KAdZWz9rxBD6I=; b=Togs/MuTIHZjybuGGuHZ4pWPqQTjVweD50mJrBHrfdgHYC4ox0t3dJTz6UKGpB6JzO dFfVywwoFsbWxJqGYY6SOtWMZBKa4VKl9DkKkUO2m5YUgrYHk7RUW/4+ta6OrAFzdppF XmjAXDLFtTLSCHDadyiRWhvJwqp9HZ8KUQWC4gvShFSt8ZF6KCW/D8wYuk82jx/XuXeK /c7rKbnqjRCJ7K2ZEdNFTMvr1+O/ALeiSI7Ts3fYQhB0xvexuWChMGhulAKf2cpLok2w x/gQA+gbRRgEHECRVStCNXj99tMQBVKt1QPuY7aQxVtOdtmhYO5V9WrsCgmsmpkgWNs4 aVRA== Received: by 10.50.53.230 with SMTP id e6mr7776457igp.46.1355705981529; Sun, 16 Dec 2012 16:59:41 -0800 (PST) Received: from localhost.localdomain ([206.191.47.130]) by mx.google.com with ESMTPS id wg2sm4508025igb.13.2012.12.16.16.59.40 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 16 Dec 2012 16:59:40 -0800 (PST) From: Christopher Cordahi To: David Woodhouse Subject: [PATCH 1/2] mtd: cmdlinepart: fix skipping zero sized partition Date: Sun, 16 Dec 2012 19:59:29 -0500 Message-Id: <714bcce84fccef617818f8916475a666f880cbf1.1355438632.git.christophercordahi@nanometrics.ca> X-Mailer: git-send-email 1.7.1 In-Reply-To: References: In-Reply-To: References: X-Gm-Message-State: ALoCoQmxq1q1eUwceRddtbImbhJuzc6CkxEpo4tUD3ceP6U8EmfapTx+CpCXstFKFoohN8123xE/ X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20121216_195943_069025_BAFDE757 X-CRM114-Status: GOOD ( 12.92 ) X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.210.177 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: Artem Bityutskiy , Linux MTD mailing list , Shmulik Ladkani , Christopher Cordahi X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-mtd-bounces@lists.infradead.org Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Decrement index i after skipping a zero sized partition. On next loop iteration, the index will be the same as before, but the data will be new as it was moved when earlier partition was skipped. Signed-off-by: Christopher Cordahi Acked-by: Shmulik Ladkani --- drivers/mtd/cmdlinepart.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/drivers/mtd/cmdlinepart.c b/drivers/mtd/cmdlinepart.c index c533f27..c1efb4c 100644 --- a/drivers/mtd/cmdlinepart.c +++ b/drivers/mtd/cmdlinepart.c @@ -337,6 +337,7 @@ static int parse_cmdline_partitions(struct mtd_info *master, part->num_parts--; memmove(&part->parts[i], &part->parts[i + 1], sizeof(*part->parts) * (part->num_parts - i)); + i--; continue; }