diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2011-09-10 03:14:02 +0400 |
---|---|---|
committer | Richard Weinberger <richard@nod.at> | 2012-03-25 03:29:53 +0400 |
commit | 31efcebb7d7196adcee73027f513d7c0bf572b47 (patch) | |
tree | c3064342091568bd66f1f5cd85b3c1972ed697da /arch/um/drivers/chan_kern.c | |
parent | d8c215adbf3901aa7d00a0f17f08d77be689f838 (diff) | |
download | linux-31efcebb7d7196adcee73027f513d7c0bf572b47.tar.xz |
um: fix races between line_open() and line_config()
Pull parse_chan_pair() call into setup_one_line(), under the mutex.
We really don't want open() to succeed before parse_chan_pair() had
been done (or after it has failed, BTW). We also want "remove con<n>"
to free irqs, etc., same as "config con<n>=none".
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'arch/um/drivers/chan_kern.c')
-rw-r--r-- | arch/um/drivers/chan_kern.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/um/drivers/chan_kern.c b/arch/um/drivers/chan_kern.c index 420e2c800799..3a95498155a1 100644 --- a/arch/um/drivers/chan_kern.c +++ b/arch/um/drivers/chan_kern.c @@ -551,6 +551,9 @@ int parse_chan_pair(char *str, struct line *line, int device, INIT_LIST_HEAD(chans); } + if (!str) + return 0; + out = strchr(str, ','); if (out != NULL) { in = str; |