File tree 1 file changed +8
-4
lines changed
1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -550,10 +550,12 @@ static int uart_put_char(struct tty_struct *tty, unsigned char c)
550
550
int ret = 0 ;
551
551
552
552
circ = & state -> xmit ;
553
- if (!circ -> buf )
553
+ port = uart_port_lock (state , flags );
554
+ if (!circ -> buf ) {
555
+ uart_port_unlock (port , flags );
554
556
return 0 ;
557
+ }
555
558
556
- port = uart_port_lock (state , flags );
557
559
if (port && uart_circ_chars_free (circ ) != 0 ) {
558
560
circ -> buf [circ -> head ] = c ;
559
561
circ -> head = (circ -> head + 1 ) & (UART_XMIT_SIZE - 1 );
@@ -586,11 +588,13 @@ static int uart_write(struct tty_struct *tty,
586
588
return - EL3HLT ;
587
589
}
588
590
591
+ port = uart_port_lock (state , flags );
589
592
circ = & state -> xmit ;
590
- if (!circ -> buf )
593
+ if (!circ -> buf ) {
594
+ uart_port_unlock (port , flags );
591
595
return 0 ;
596
+ }
592
597
593
- port = uart_port_lock (state , flags );
594
598
while (port ) {
595
599
c = CIRC_SPACE_TO_END (circ -> head , circ -> tail , UART_XMIT_SIZE );
596
600
if (count < c )
You can’t perform that action at this time.
0 commit comments