+ lib-sg_pool-remove-unnecessary-null-check-when-free-the-object.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Subject: lib/sg_pool.c: remove unnecessary null check when freeing object
has been added to the -mm tree.  Its filename is
     lib-sg_pool-remove-unnecessary-null-check-when-free-the-object.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/lib-sg_pool-remove-unnecessary-null-check-when-free-the-object.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/lib-sg_pool-remove-unnecessary-null-check-when-free-the-object.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: zhong jiang <zhongjiang@xxxxxxxxxx>
Subject: 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@xxxxxxxxxx
Signed-off-by: zhong jiang <zhongjiang@xxxxxxxxxx>
Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 lib/sg_pool.c |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

--- a/lib/sg_pool.c~lib-sg_pool-remove-unnecessary-null-check-when-free-the-object
+++ a/lib/sg_pool.c
@@ -148,10 +148,9 @@ static __init int sg_pool_init(void)
 cleanup_sdb:
 	for (i = 0; i < SG_MEMPOOL_NR; i++) {
 		struct sg_pool *sgp = sg_pools + i;
-		if (sgp->pool)
-			mempool_destroy(sgp->pool);
-		if (sgp->slab)
-			kmem_cache_destroy(sgp->slab);
+
+		mempool_destroy(sgp->pool);
+		kmem_cache_destroy(sgp->slab);
 	}
 
 	return -ENOMEM;
_

Patches currently in -mm which might be from zhongjiang@xxxxxxxxxx are

mm-page_owner-align-with-pageblock_nr-pages.patch
radix-tree-use-div_round_up-instead-of-reimplementing-its-function.patch
lib-sg_pool-remove-unnecessary-null-check-when-free-the-object.patch




[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux