mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-26 04:16:39 +00:00
lib/sg_pool.c: remove unnecessary null check when freeing object
mempool_destroy(NULL) and kmem_cache_destroy(NULL) are legal Link: http://lkml.kernel.org/r/1533054107-35657-1-git-send-email-zhongjiang@huawei.com Signed-off-by: zhong jiang <zhongjiang@huawei.com> Cc: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
7a20c2fa1c
commit
7f476715d0
1 changed files with 3 additions and 4 deletions
|
@ -148,10 +148,9 @@ static __init int sg_pool_init(void)
|
||||||
cleanup_sdb:
|
cleanup_sdb:
|
||||||
for (i = 0; i < SG_MEMPOOL_NR; i++) {
|
for (i = 0; i < SG_MEMPOOL_NR; i++) {
|
||||||
struct sg_pool *sgp = sg_pools + i;
|
struct sg_pool *sgp = sg_pools + i;
|
||||||
if (sgp->pool)
|
|
||||||
mempool_destroy(sgp->pool);
|
mempool_destroy(sgp->pool);
|
||||||
if (sgp->slab)
|
kmem_cache_destroy(sgp->slab);
|
||||||
kmem_cache_destroy(sgp->slab);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
Loading…
Reference in a new issue