[PATCH] mtd: cmdlinepart: fix the wrong partitions number when truncating occurs

Artem Bityutskiy dedekind1 at gmail.com
Fri Aug 24 11:43:02 EDT 2012


On Sat, 2012-08-18 at 12:51 -0400, Huang Shijie wrote:
> diff --git a/drivers/mtd/cmdlinepart.c b/drivers/mtd/cmdlinepart.c
> index 4558e0f..fc960a3 100644
> --- a/drivers/mtd/cmdlinepart.c
> +++ b/drivers/mtd/cmdlinepart.c
> @@ -344,7 +344,8 @@ static int parse_cmdline_partitions(struct mtd_info *master,
>  					       "%s: partitioning exceeds flash size, truncating\n",
>  					       part->mtd_id);
>  					part->parts[i].size = master->size - offset;
> -					part->num_parts = i;
> +					part->num_parts = i + 1;
> +					break;
>  				}
>  				offset += part->parts[i].size;
>  			}

I do not understand this change. Could you explain some more which
problem you solve and how?

-- 
Best Regards,
Artem Bityutskiy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part
URL: <http://lists.infradead.org/pipermail/linux-mtd/attachments/20120824/562f8b28/attachment.sig>


More information about the linux-mtd mailing list