hc
2023-12-09 b22da3d8526a935aa31e086e63f60ff3246cb61c
kernel/arch/um/drivers/chan_user.c
....@@ -1,6 +1,6 @@
1
+// SPDX-License-Identifier: GPL-2.0
12 /*
23 * Copyright (C) 2000 - 2007 Jeff Dike (jdike@{linux.intel,addtoit}.com)
3
- * Licensed under the GPL
44 */
55
66 #include <stdlib.h>
....@@ -220,7 +220,7 @@
220220 unsigned long *stack_out)
221221 {
222222 struct winch_data data;
223
- int fds[2], n, err;
223
+ int fds[2], n, err, pid;
224224 char c;
225225
226226 err = os_pipe(fds, 1, 1);
....@@ -238,8 +238,9 @@
238238 * problem with /dev/net/tun, which if held open by this
239239 * thread, prevents the TUN/TAP device from being reused.
240240 */
241
- err = run_helper_thread(winch_thread, &data, CLONE_FILES, stack_out);
242
- if (err < 0) {
241
+ pid = run_helper_thread(winch_thread, &data, CLONE_FILES, stack_out);
242
+ if (pid < 0) {
243
+ err = pid;
243244 printk(UM_KERN_ERR "fork of winch_thread failed - errno = %d\n",
244245 -err);
245246 goto out_close;
....@@ -263,7 +264,7 @@
263264 goto out_close;
264265 }
265266
266
- return err;
267
+ return pid;
267268
268269 out_close:
269270 close(fds[1]);