diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mtd/chips/cfi_cmdset_0001.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/mtd/chips/cfi_cmdset_0001.c b/drivers/mtd/chips/cfi_cmdset_0001.c index e772803b4959..8664feebc93b 100644 --- a/drivers/mtd/chips/cfi_cmdset_0001.c +++ b/drivers/mtd/chips/cfi_cmdset_0001.c | |||
@@ -329,6 +329,7 @@ read_pri_intelext(struct map_info *map, __u16 adr) | |||
329 | { | 329 | { |
330 | struct cfi_private *cfi = map->fldrv_priv; | 330 | struct cfi_private *cfi = map->fldrv_priv; |
331 | struct cfi_pri_intelext *extp; | 331 | struct cfi_pri_intelext *extp; |
332 | unsigned int extra_size = 0; | ||
332 | unsigned int extp_size = sizeof(*extp); | 333 | unsigned int extp_size = sizeof(*extp); |
333 | 334 | ||
334 | again: | 335 | again: |
@@ -352,19 +353,24 @@ read_pri_intelext(struct map_info *map, __u16 adr) | |||
352 | extp->BlkStatusRegMask = le16_to_cpu(extp->BlkStatusRegMask); | 353 | extp->BlkStatusRegMask = le16_to_cpu(extp->BlkStatusRegMask); |
353 | extp->ProtRegAddr = le16_to_cpu(extp->ProtRegAddr); | 354 | extp->ProtRegAddr = le16_to_cpu(extp->ProtRegAddr); |
354 | 355 | ||
355 | if (extp->MajorVersion == '1' && extp->MinorVersion >= '3') { | 356 | if (extp->MinorVersion >= '0') { |
356 | unsigned int extra_size = 0; | 357 | extra_size = 0; |
357 | int nb_parts, i; | ||
358 | 358 | ||
359 | /* Protection Register info */ | 359 | /* Protection Register info */ |
360 | extra_size += (extp->NumProtectionFields - 1) * | 360 | extra_size += (extp->NumProtectionFields - 1) * |
361 | sizeof(struct cfi_intelext_otpinfo); | 361 | sizeof(struct cfi_intelext_otpinfo); |
362 | } | ||
362 | 363 | ||
364 | if (extp->MinorVersion >= '1') { | ||
363 | /* Burst Read info */ | 365 | /* Burst Read info */ |
364 | extra_size += 2; | 366 | extra_size += 2; |
365 | if (extp_size < sizeof(*extp) + extra_size) | 367 | if (extp_size < sizeof(*extp) + extra_size) |
366 | goto need_more; | 368 | goto need_more; |
367 | extra_size += extp->extra[extra_size-1]; | 369 | extra_size += extp->extra[extra_size - 1]; |
370 | } | ||
371 | |||
372 | if (extp->MinorVersion >= '3') { | ||
373 | int nb_parts, i; | ||
368 | 374 | ||
369 | /* Number of hardware-partitions */ | 375 | /* Number of hardware-partitions */ |
370 | extra_size += 1; | 376 | extra_size += 1; |