diff options
Diffstat (limited to 'drivers/mtd/ubi/wl.c')
-rw-r--r-- | drivers/mtd/ubi/wl.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/mtd/ubi/wl.c b/drivers/mtd/ubi/wl.c index f25ae2910ad0..acb5520f7f3d 100644 --- a/drivers/mtd/ubi/wl.c +++ b/drivers/mtd/ubi/wl.c | |||
@@ -826,7 +826,8 @@ static int wear_leveling_worker(struct ubi_device *ubi, struct ubi_work *wrk, | |||
826 | err = schedule_erase(ubi, e1, 0); | 826 | err = schedule_erase(ubi, e1, 0); |
827 | if (err) { | 827 | if (err) { |
828 | kmem_cache_free(ubi_wl_entry_slab, e1); | 828 | kmem_cache_free(ubi_wl_entry_slab, e1); |
829 | kmem_cache_free(ubi_wl_entry_slab, e2); | 829 | if (e2) |
830 | kmem_cache_free(ubi_wl_entry_slab, e2); | ||
830 | goto out_ro; | 831 | goto out_ro; |
831 | } | 832 | } |
832 | 833 | ||