]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
um: Use err consistently in userspace()
authorTiwei Bie <tiwei.btw@antgroup.com>
Fri, 11 Jul 2025 06:50:19 +0000 (14:50 +0800)
committerJohannes Berg <johannes.berg@intel.com>
Sun, 13 Jul 2025 17:42:49 +0000 (19:42 +0200)
Avoid declaring a new variable 'ret' inside the 'if (using_seccomp)'
block, as the existing 'err' variable declared at the top of the
function already serves the same purpose.

Signed-off-by: Tiwei Bie <tiwei.btw@antgroup.com>
Link: https://patch.msgid.link/20250711065021.2535362-2-tiwei.bie@linux.dev
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
arch/um/os-Linux/skas/process.c

index d3dd4fb559cfd354091cdb6e23b41f339675a5a5..79541574f70d500c36de88842ec17bf2f1f920ea 100644 (file)
@@ -592,12 +592,11 @@ void userspace(struct uml_pt_regs *regs)
                if (using_seccomp) {
                        struct mm_id *mm_id = current_mm_id();
                        struct stub_data *proc_data = (void *) mm_id->stack;
-                       int ret;
 
-                       ret = set_stub_state(regs, proc_data, singlestepping());
-                       if (ret) {
+                       err = set_stub_state(regs, proc_data, singlestepping());
+                       if (err) {
                                printk(UM_KERN_ERR "%s - failed to set regs: %d",
-                                      __func__, ret);
+                                      __func__, err);
                                fatal_sigsegv();
                        }
 
@@ -623,10 +622,10 @@ void userspace(struct uml_pt_regs *regs)
                        mm_id->syscall_data_len = 0;
                        mm_id->syscall_fd_num = 0;
 
-                       ret = get_stub_state(regs, proc_data, NULL);
-                       if (ret) {
+                       err = get_stub_state(regs, proc_data, NULL);
+                       if (err) {
                                printk(UM_KERN_ERR "%s - failed to get regs: %d",
-                                      __func__, ret);
+                                      __func__, err);
                                fatal_sigsegv();
                        }