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>] [day] [month] [year] [list]
Message-Id: <20221009034153.4418-1-xupengfei@nfschina.com>
Date:   Sun,  9 Oct 2022 11:41:54 +0800
From:   XU pengfei <xupengfei@...china.com>
To:     akpm@...ux-foundation.org
Cc:     linux-mm@...ck.org, linux-kernel@...r.kernel.org,
        XU pengfei <xupengfei@...china.com>
Subject: [PATCH 1/1] mm/mmap_lock: Remove unnecessary 'NULL' values from Pointer

Remove unnecessary 'NULL' values from Pointer and goto statement

Signed-off-by: XU pengfei <xupengfei@...china.com>
---
 mm/mmap_lock.c | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/mm/mmap_lock.c b/mm/mmap_lock.c
index 1854850b4b89..d0c2a5eae341 100644
--- a/mm/mmap_lock.c
+++ b/mm/mmap_lock.c
@@ -198,23 +198,24 @@ void trace_mmap_lock_unreg(void)
  */
 static const char *get_mm_memcg_path(struct mm_struct *mm)
 {
-	char *buf = NULL;
+	char *buf;
 	struct mem_cgroup *memcg = get_mem_cgroup_from_mm(mm);
 
 	if (memcg == NULL)
-		goto out;
-	if (unlikely(memcg->css.cgroup == NULL))
-		goto out_put;
+		return NULL;
+	if (unlikely(memcg->css.cgroup == NULL)) {
+		css_put(&memcg->css);
+		return NULL;
+	}
 
 	buf = get_memcg_path_buf();
-	if (buf == NULL)
-		goto out_put;
+	if (buf == NULL) {
+		css_put(&memcg->css);
+		return NULL;
+	}
 
 	cgroup_path(memcg->css.cgroup, buf, MEMCG_PATH_BUF_SIZE);
 
-out_put:
-	css_put(&memcg->css);
-out:
 	return buf;
 }
 
-- 
2.18.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ