diff options
Diffstat (limited to 'drivers/mtd/ubi/vtbl.c')
-rw-r--r-- | drivers/mtd/ubi/vtbl.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/mtd/ubi/vtbl.c b/drivers/mtd/ubi/vtbl.c index 83236c31c892..9926f1f9aad8 100644 --- a/drivers/mtd/ubi/vtbl.c +++ b/drivers/mtd/ubi/vtbl.c | |||
@@ -317,13 +317,15 @@ retry: | |||
317 | return err; | 317 | return err; |
318 | 318 | ||
319 | write_error: | 319 | write_error: |
320 | /* Maybe this physical eraseblock went bad, try to pick another one */ | 320 | if (err == -EIO && ++tries <= 5) { |
321 | if (++tries <= 5) | 321 | /* |
322 | err = ubi_scan_add_to_list(si, new_seb->pnum, new_seb->ec, | 322 | * Probably this physical eraseblock went bad, try to pick |
323 | &si->corr); | 323 | * another one. |
324 | kfree(new_seb); | 324 | */ |
325 | if (!err) | 325 | list_add_tail(&new_seb->u.list, &si->corr); |
326 | goto retry; | 326 | goto retry; |
327 | } | ||
328 | kfree(new_seb); | ||
327 | out_free: | 329 | out_free: |
328 | ubi_free_vid_hdr(ubi, vid_hdr); | 330 | ubi_free_vid_hdr(ubi, vid_hdr); |
329 | return err; | 331 | return err; |