Skip to content

Commit 8d1e513

Browse files
committed
Merge branch 'for-linus-4.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml
Pull uml updates from Richard Weinberger: "Minor updates for UML: - fixes for our new vector network driver by Anton - initcall cleanup by Alexander - We have a new mailinglist, sourceforge.net sucks" * 'for-linus-4.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml: um: Fix raw interface options um: Fix initialization of vector queues um: remove uml initcalls um: Update mailing list address
2 parents 6a4d4b3 + 5ec9121 commit 8d1e513

File tree

5 files changed

+15
-31
lines changed

5 files changed

+15
-31
lines changed

MAINTAINERS

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15015,8 +15015,7 @@ F: drivers/media/usb/zr364xx/
1501515015
USER-MODE LINUX (UML)
1501615016
M: Jeff Dike <[email protected]>
1501715017
M: Richard Weinberger <[email protected]>
15018-
15019-
15018+
1502015019
W: http://user-mode-linux.sourceforge.net
1502115020
T: git git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml.git
1502215021
S: Maintained

arch/um/drivers/vector_kern.c

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ static int get_transport_options(struct arglist *def)
188188
if (strncmp(transport, TRANS_TAP, TRANS_TAP_LEN) == 0)
189189
return (vec_rx | VECTOR_BPF);
190190
if (strncmp(transport, TRANS_RAW, TRANS_RAW_LEN) == 0)
191-
return (vec_rx | vec_tx);
191+
return (vec_rx | vec_tx | VECTOR_QDISC_BYPASS);
192192
return (vec_rx | vec_tx);
193193
}
194194

@@ -504,15 +504,19 @@ static struct vector_queue *create_queue(
504504

505505
result = kmalloc(sizeof(struct vector_queue), GFP_KERNEL);
506506
if (result == NULL)
507-
goto out_fail;
507+
return NULL;
508508
result->max_depth = max_size;
509509
result->dev = vp->dev;
510510
result->mmsg_vector = kmalloc(
511511
(sizeof(struct mmsghdr) * max_size), GFP_KERNEL);
512+
if (result->mmsg_vector == NULL)
513+
goto out_mmsg_fail;
512514
result->skbuff_vector = kmalloc(
513515
(sizeof(void *) * max_size), GFP_KERNEL);
514-
if (result->mmsg_vector == NULL || result->skbuff_vector == NULL)
515-
goto out_fail;
516+
if (result->skbuff_vector == NULL)
517+
goto out_skb_fail;
518+
519+
/* further failures can be handled safely by destroy_queue*/
516520

517521
mmsg_vector = result->mmsg_vector;
518522
for (i = 0; i < max_size; i++) {
@@ -563,6 +567,11 @@ static struct vector_queue *create_queue(
563567
result->head = 0;
564568
result->tail = 0;
565569
return result;
570+
out_skb_fail:
571+
kfree(result->mmsg_vector);
572+
out_mmsg_fail:
573+
kfree(result);
574+
return NULL;
566575
out_fail:
567576
destroy_queue(result);
568577
return NULL;
@@ -1232,9 +1241,8 @@ static int vector_net_open(struct net_device *dev)
12321241

12331242
if ((vp->options & VECTOR_QDISC_BYPASS) != 0) {
12341243
if (!uml_raw_enable_qdisc_bypass(vp->fds->rx_fd))
1235-
vp->options = vp->options | VECTOR_BPF;
1244+
vp->options |= VECTOR_BPF;
12361245
}
1237-
12381246
if ((vp->options & VECTOR_BPF) != 0)
12391247
vp->bpf = uml_vector_default_bpf(vp->fds->rx_fd, dev->dev_addr);
12401248

arch/um/include/asm/common.lds.S

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,6 @@
5353
CON_INITCALL
5454
}
5555

56-
.uml.initcall.init : {
57-
__uml_initcall_start = .;
58-
*(.uml.initcall.init)
59-
__uml_initcall_end = .;
60-
}
61-
6256
SECURITY_INIT
6357

6458
.exitcall : {

arch/um/include/shared/init.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,10 @@ struct uml_param {
6464
int (*setup_func)(char *, int *);
6565
};
6666

67-
extern initcall_t __uml_initcall_start, __uml_initcall_end;
6867
extern initcall_t __uml_postsetup_start, __uml_postsetup_end;
6968
extern const char *__uml_help_start, *__uml_help_end;
7069
#endif
7170

72-
#define __uml_initcall(fn) \
73-
static initcall_t __uml_initcall_##fn __uml_init_call = fn
74-
7571
#define __uml_exitcall(fn) \
7672
static exitcall_t __uml_exitcall_##fn __uml_exit_call = fn
7773

@@ -108,7 +104,6 @@ extern struct uml_param __uml_setup_start, __uml_setup_end;
108104
*/
109105
#define __uml_init_setup __used __section(.uml.setup.init)
110106
#define __uml_setup_help __used __section(.uml.help.init)
111-
#define __uml_init_call __used __section(.uml.initcall.init)
112107
#define __uml_postsetup_call __used __section(.uml.postsetup.init)
113108
#define __uml_exit_call __used __section(.uml.exitcall.exit)
114109

arch/um/os-Linux/main.c

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,6 @@ static void set_stklim(void)
4040
}
4141
}
4242

43-
static __init void do_uml_initcalls(void)
44-
{
45-
initcall_t *call;
46-
47-
call = &__uml_initcall_start;
48-
while (call < &__uml_initcall_end) {
49-
(*call)();
50-
call++;
51-
}
52-
}
53-
5443
static void last_ditch_exit(int sig)
5544
{
5645
uml_cleanup();
@@ -151,7 +140,6 @@ int __init main(int argc, char **argv, char **envp)
151140
scan_elf_aux(envp);
152141
#endif
153142

154-
do_uml_initcalls();
155143
change_sig(SIGPIPE, 0);
156144
ret = linux_main(argc, argv);
157145

0 commit comments

Comments
 (0)