diff options
Diffstat (limited to 'fs/xfs/xfs_mru_cache.c')
-rw-r--r-- | fs/xfs/xfs_mru_cache.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/fs/xfs/xfs_mru_cache.c b/fs/xfs/xfs_mru_cache.c index a0b2c0a2589a..afee7eb24323 100644 --- a/fs/xfs/xfs_mru_cache.c +++ b/fs/xfs/xfs_mru_cache.c | |||
@@ -307,15 +307,18 @@ xfs_mru_cache_init(void) | |||
307 | xfs_mru_elem_zone = kmem_zone_init(sizeof(xfs_mru_cache_elem_t), | 307 | xfs_mru_elem_zone = kmem_zone_init(sizeof(xfs_mru_cache_elem_t), |
308 | "xfs_mru_cache_elem"); | 308 | "xfs_mru_cache_elem"); |
309 | if (!xfs_mru_elem_zone) | 309 | if (!xfs_mru_elem_zone) |
310 | return ENOMEM; | 310 | goto out; |
311 | 311 | ||
312 | xfs_mru_reap_wq = create_singlethread_workqueue("xfs_mru_cache"); | 312 | xfs_mru_reap_wq = create_singlethread_workqueue("xfs_mru_cache"); |
313 | if (!xfs_mru_reap_wq) { | 313 | if (!xfs_mru_reap_wq) |
314 | kmem_zone_destroy(xfs_mru_elem_zone); | 314 | goto out_destroy_mru_elem_zone; |
315 | return ENOMEM; | ||
316 | } | ||
317 | 315 | ||
318 | return 0; | 316 | return 0; |
317 | |||
318 | out_destroy_mru_elem_zone: | ||
319 | kmem_zone_destroy(xfs_mru_elem_zone); | ||
320 | out: | ||
321 | return -ENOMEM; | ||
319 | } | 322 | } |
320 | 323 | ||
321 | void | 324 | void |
@@ -382,9 +385,9 @@ xfs_mru_cache_create( | |||
382 | 385 | ||
383 | exit: | 386 | exit: |
384 | if (err && mru && mru->lists) | 387 | if (err && mru && mru->lists) |
385 | kmem_free(mru->lists, mru->grp_count * sizeof(*mru->lists)); | 388 | kmem_free(mru->lists); |
386 | if (err && mru) | 389 | if (err && mru) |
387 | kmem_free(mru, sizeof(*mru)); | 390 | kmem_free(mru); |
388 | 391 | ||
389 | return err; | 392 | return err; |
390 | } | 393 | } |
@@ -424,8 +427,8 @@ xfs_mru_cache_destroy( | |||
424 | 427 | ||
425 | xfs_mru_cache_flush(mru); | 428 | xfs_mru_cache_flush(mru); |
426 | 429 | ||
427 | kmem_free(mru->lists, mru->grp_count * sizeof(*mru->lists)); | 430 | kmem_free(mru->lists); |
428 | kmem_free(mru, sizeof(*mru)); | 431 | kmem_free(mru); |
429 | } | 432 | } |
430 | 433 | ||
431 | /* | 434 | /* |