| .. | .. |
|---|
| 146 | 146 | if (ubi->fm_anchor) { |
|---|
| 147 | 147 | wl_tree_add(ubi->fm_anchor, &ubi->free); |
|---|
| 148 | 148 | ubi->free_count++; |
|---|
| 149 | + ubi->fm_anchor = NULL; |
|---|
| 149 | 150 | } |
|---|
| 150 | 151 | |
|---|
| 151 | | - /* |
|---|
| 152 | | - * All available PEBs are in ubi->free, now is the time to get |
|---|
| 153 | | - * the best anchor PEBs. |
|---|
| 154 | | - */ |
|---|
| 155 | | - ubi->fm_anchor = ubi_wl_get_fm_peb(ubi, 1); |
|---|
| 152 | + if (!ubi->fm_disabled) |
|---|
| 153 | + /* |
|---|
| 154 | + * All available PEBs are in ubi->free, now is the time to get |
|---|
| 155 | + * the best anchor PEBs. |
|---|
| 156 | + */ |
|---|
| 157 | + ubi->fm_anchor = ubi_wl_get_fm_peb(ubi, 1); |
|---|
| 156 | 158 | |
|---|
| 157 | 159 | for (;;) { |
|---|
| 158 | 160 | enough = 0; |
|---|