diff options
-rw-r--r-- | drivers/mtd/ubi/scan.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/mtd/ubi/scan.c b/drivers/mtd/ubi/scan.c index 0cb17d936b5a..b99318ed51e6 100644 --- a/drivers/mtd/ubi/scan.c +++ b/drivers/mtd/ubi/scan.c | |||
@@ -1174,7 +1174,7 @@ struct ubi_scan_info *ubi_scan(struct ubi_device *ubi) | |||
1174 | 1174 | ||
1175 | ech = kzalloc(ubi->ec_hdr_alsize, GFP_KERNEL); | 1175 | ech = kzalloc(ubi->ec_hdr_alsize, GFP_KERNEL); |
1176 | if (!ech) | 1176 | if (!ech) |
1177 | goto out_slab; | 1177 | goto out_si; |
1178 | 1178 | ||
1179 | vidh = ubi_zalloc_vid_hdr(ubi, GFP_KERNEL); | 1179 | vidh = ubi_zalloc_vid_hdr(ubi, GFP_KERNEL); |
1180 | if (!vidh) | 1180 | if (!vidh) |
@@ -1235,8 +1235,6 @@ out_vidh: | |||
1235 | ubi_free_vid_hdr(ubi, vidh); | 1235 | ubi_free_vid_hdr(ubi, vidh); |
1236 | out_ech: | 1236 | out_ech: |
1237 | kfree(ech); | 1237 | kfree(ech); |
1238 | out_slab: | ||
1239 | kmem_cache_destroy(si->scan_leb_slab); | ||
1240 | out_si: | 1238 | out_si: |
1241 | ubi_scan_destroy_si(si); | 1239 | ubi_scan_destroy_si(si); |
1242 | return ERR_PTR(err); | 1240 | return ERR_PTR(err); |
@@ -1325,7 +1323,9 @@ void ubi_scan_destroy_si(struct ubi_scan_info *si) | |||
1325 | } | 1323 | } |
1326 | } | 1324 | } |
1327 | 1325 | ||
1328 | kmem_cache_destroy(si->scan_leb_slab); | 1326 | if (si->scan_leb_slab) |
1327 | kmem_cache_destroy(si->scan_leb_slab); | ||
1328 | |||
1329 | kfree(si); | 1329 | kfree(si); |
1330 | } | 1330 | } |
1331 | 1331 | ||