Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c4399016 authored by Jeff Dike's avatar Jeff Dike Committed by Linus Torvalds
Browse files

uml: simplify helper stack handling



run_helper and run_helper_thread had arguments which were the same in all
callers.  run_helper's stack_out was always NULL and run_helper_thread's
stack_order was always 0.  These are now gone, and the constants folded
into the code.

Also fixed leaks of the helper stack in the AIO and SIGIO code.

Signed-off-by: default avatarJeff Dike <jdike@linux.intel.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 42a359e3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -161,7 +161,7 @@ static int winch_tramp(int fd, struct tty_struct *tty, int *fd_out,
	 * problem with /dev/net/tun, which if held open by this
	 * thread, prevents the TUN/TAP device from being reused.
	 */
	err = run_helper_thread(winch_thread, &data, CLONE_FILES, stack_out, 0);
	err = run_helper_thread(winch_thread, &data, CLONE_FILES, stack_out);
	if(err < 0){
		printk("fork of winch_thread failed - errno = %d\n", -err);
		goto out_close;
+1 −1
Original line number Diff line number Diff line
@@ -68,7 +68,7 @@ int start_watchdog(int *in_fd_ret, int *out_fd_ret, char *sock)
		args = pid_args;
	}

	pid = run_helper(pre_exec, &data, args, NULL);
	pid = run_helper(pre_exec, &data, args);

	os_close_file(out_fds[0]);
	os_close_file(in_fds[1]);
+1 −1
Original line number Diff line number Diff line
@@ -187,7 +187,7 @@ static int change_tramp(char **argv, char *output, int output_len)
	}
	pe_data.close_me = fds[0];
	pe_data.stdout = fds[1];
	pid = run_helper(change_pre_exec, &pe_data, argv, NULL);
	pid = run_helper(change_pre_exec, &pe_data, argv);

	if (pid > 0)	/* Avoid hang as we won't get data in failure case. */
		read_output(fds[0], output, output_len);
+1 −1
Original line number Diff line number Diff line
@@ -188,7 +188,7 @@ int port_connection(int fd, int *socket, int *pid_out)
		{ .sock_fd  		= new,
		  .pipe_fd 		= socket[1] });

	err = run_helper(port_pre_exec, &data, argv, NULL);
	err = run_helper(port_pre_exec, &data, argv);
	if(err < 0)
		goto out_shutdown;

+1 −1
Original line number Diff line number Diff line
@@ -85,7 +85,7 @@ static int slip_tramp(char **argv, int fd)
	pe_data.stdin = fd;
	pe_data.stdout = fds[1];
	pe_data.close_me = fds[0];
	err = run_helper(slip_pre_exec, &pe_data, argv, NULL);
	err = run_helper(slip_pre_exec, &pe_data, argv);
	if(err < 0)
		goto out_close;
	pid = err;
Loading