lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 11 Apr 2023 17:13:22 +0800
From:   zhaoxinchao <ChrisXinchao@...look.com>
To:     bagasdotme@...il.com
Cc:     ChrisXinchao@...look.com, akpm@...ux-foundation.org, cl@...ux.com,
        iamjoonsoo.kim@....com, linux-kernel@...r.kernel.org,
        linux-mm@...ck.org, penberg@...nel.org, rientjes@...gle.com,
        vbabka@...e.cz, zhaoxinchao <chrisxinchao@...look.com>
Subject: [PATCH v2] mm: Fixed incorrect comment for _kmem_cache_create function

From: zhaoxinchao <chrisxinchao@...look.com>

Actually __kmem_cache_create() returns a status :
0 is success
nonezero are failed.

This function has three return positions. In addition to successfully
return 0, the first failed position will return - E2BIG, and the second
position will return nonzero value for setup_cpu_cache function failure.

Signed-off-by: zhaoxinchao <chrisxinchao@...look.com>
---
 mm/slab.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/mm/slab.c b/mm/slab.c
index edbe722fb..399daa4d0 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -1893,7 +1893,12 @@ static bool set_on_slab_cache(struct kmem_cache *cachep,
  * @cachep: cache management descriptor
  * @flags: SLAB flags
  *
- * Returns a ptr to the cache on success, NULL on failure.
+ * Returns zero on success, nonzero on failure.
+ * This function has three return positions.
+ * In addition to successfully return 0, the
+ * first failed position will return - E2BIG,
+ * and the second position will return nonzero
+ * value for setup_cpu_cache function failure.
  * Cannot be called within an int, but can be interrupted.
  * The @ctor is run when new pages are allocated by the cache.
  *
-- 
2.39.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ