Commit cba737fa authored by Tiwei Bie's avatar Tiwei Bie Committed by Johannes Berg
Browse files

um: Use err consistently in userspace()



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: default avatarTiwei Bie <tiwei.btw@antgroup.com>
Link: https://patch.msgid.link/20250711065021.2535362-2-tiwei.bie@linux.dev


Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 8129b9e8
Loading
Loading
Loading
Loading
+6 −7
Original line number Diff line number Diff line
@@ -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();
			}