s390/debug: optimize acquiring spinlock on failure in debug_info_copy()
PATCH 1/1 s390/debug: optimize acquiring spinlock on failure in debug_info_copy()
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 <[email protected]>
--- arch/s390/kernel/debug.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/s390/kernel/debug.c +2 -2
@@ -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)) {
Signature · 1 line
2.45.2