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: <20220611080904.92120-1-wuchi.zero@gmail.com>
Date:   Sat, 11 Jun 2022 16:09:04 +0800
From:   wuchi <wuchi.zero@...il.com>
To:     bhutchings@...arflare.com, decot@...glers.com, info@...ux.net,
        josh@...htriplett.org
Cc:     akpm@...ux-foundation.org, linux-kernel@...r.kernel.org
Subject: [PATCH] lib/cpu_rmap: do *_get before using cpu_rmap

It's ok in irq_cpu_rmap_add:

glue->rmap = rmap;
cpu_rmap_get(rmap);

however, it's logically better to do *_get before passing the var..

Signed-off-by: wuchi <wuchi.zero@...il.com>
---
 lib/cpu_rmap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/cpu_rmap.c b/lib/cpu_rmap.c
index f08d9c56f712..590eb544f0d8 100644
--- a/lib/cpu_rmap.c
+++ b/lib/cpu_rmap.c
@@ -291,8 +291,8 @@ int irq_cpu_rmap_add(struct cpu_rmap *rmap, int irq)
 		return -ENOMEM;
 	glue->notify.notify = irq_cpu_rmap_notify;
 	glue->notify.release = irq_cpu_rmap_release;
-	glue->rmap = rmap;
 	cpu_rmap_get(rmap);
+	glue->rmap = rmap;
 	glue->index = cpu_rmap_add(rmap, glue);
 	rc = irq_set_affinity_notifier(irq, &glue->notify);
 	if (rc) {
-- 
2.20.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ