diff options
author | Jiri Slaby <jirislaby@gmail.com> | 2007-02-10 04:45:23 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-11 13:51:29 -0500 |
commit | 5ff7205dd9084c96cf2bedc4d0481790c5a7a635 (patch) | |
tree | 6669cf9dba51753349b355d8928e0707d08239ea /drivers/char | |
parent | 722d5e4ae89f061582cc46ccbbd3b5ae87a6e165 (diff) |
[PATCH] Char: mxser_new, lock count and flags
Both open count and INITIALIZED flag should be changed under lock.
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Cc: <osv@javad.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/mxser_new.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/char/mxser_new.c b/drivers/char/mxser_new.c index 1c8e00c4caad..d52ecff7320a 100644 --- a/drivers/char/mxser_new.c +++ b/drivers/char/mxser_new.c | |||
@@ -853,9 +853,9 @@ static int mxser_startup(struct mxser_port *info) | |||
853 | * and set the speed of the serial port | 853 | * and set the speed of the serial port |
854 | */ | 854 | */ |
855 | mxser_change_speed(info, NULL); | 855 | mxser_change_speed(info, NULL); |
856 | info->flags |= ASYNC_INITIALIZED; | ||
856 | spin_unlock_irqrestore(&info->slock, flags); | 857 | spin_unlock_irqrestore(&info->slock, flags); |
857 | 858 | ||
858 | info->flags |= ASYNC_INITIALIZED; | ||
859 | return 0; | 859 | return 0; |
860 | } | 860 | } |
861 | 861 | ||
@@ -925,6 +925,7 @@ static void mxser_shutdown(struct mxser_port *info) | |||
925 | static int mxser_open(struct tty_struct *tty, struct file *filp) | 925 | static int mxser_open(struct tty_struct *tty, struct file *filp) |
926 | { | 926 | { |
927 | struct mxser_port *info; | 927 | struct mxser_port *info; |
928 | unsigned long flags; | ||
928 | int retval, line; | 929 | int retval, line; |
929 | 930 | ||
930 | line = tty->index; | 931 | line = tty->index; |
@@ -941,7 +942,9 @@ static int mxser_open(struct tty_struct *tty, struct file *filp) | |||
941 | /* | 942 | /* |
942 | * Start up serial port | 943 | * Start up serial port |
943 | */ | 944 | */ |
945 | spin_lock_irqsave(&info->slock, flags); | ||
944 | info->count++; | 946 | info->count++; |
947 | spin_unlock_irqrestore(&info->slock, flags); | ||
945 | retval = mxser_startup(info); | 948 | retval = mxser_startup(info); |
946 | if (retval) | 949 | if (retval) |
947 | return retval; | 950 | return retval; |