* [PATCH] s390/debug: optimize acquiring spinlock on failure in debug_info_copy()
@ 2024-07-17 21:18 Yunseong Kim
0 siblings, 0 replies; only message in thread
From: Yunseong Kim @ 2024-07-17 21:18 UTC (permalink / raw)
To: Heiko Carstens, Vasily Gorbik, Alexander Gordeev,
Christian Borntraeger, Sven Schnelle
Cc: Luis Chamberlain, Joel Granados, MichelleJin, linux-s390,
linux-kernel
Optimize acquiring the spinlock once more and then exiting without any
additional actions, when handling of debug_info_alloc() failed.
Fixes: 942eaabd5d77 ("[PATCH] s390: debug feature changes")
Signed-off-by: Yunseong Kim <yskelg@gmail.com>
---
arch/s390/kernel/debug.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/s390/kernel/debug.c b/arch/s390/kernel/debug.c
index 85328a0ef3b6..c64f17cc1ebe 100644
--- a/arch/s390/kernel/debug.c
+++ b/arch/s390/kernel/debug.c
@@ -333,9 +333,9 @@ static debug_info_t *debug_info_copy(debug_info_t *in, int mode)
do {
rc = debug_info_alloc(in->name, in->pages_per_area,
in->nr_areas, in->buf_size, in->level, mode);
- spin_lock_irqsave(&in->lock, flags);
if (!rc)
- goto out;
+ return rc;
+ spin_lock_irqsave(&in->lock, flags);
/* has something changed in the meantime ? */
if ((rc->pages_per_area == in->pages_per_area) &&
(rc->nr_areas == in->nr_areas)) {
--
2.45.2
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2024-07-17 21:26 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-17 21:18 [PATCH] s390/debug: optimize acquiring spinlock on failure in debug_info_copy() Yunseong Kim
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox