Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'tty-5.0-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty

Pull tty/serial fixes from Greg KH:
"Here are some small tty and serial fixes for 5.0-rc6.

Nothing huge, just a few small fixes for reported issues. The speakup
fix is in here as it is a tty operation issue.

All of these have been in linux-next for a while with no reported
problems"

* tag 'tty-5.0-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
serial: fix race between flush_to_ldisc and tty_open
staging: speakup: fix tty-operation NULL derefs
serial: sh-sci: Do not free irqs that have already been freed
serial: 8250_pci: Make PCI class test non fatal
tty: serial: 8250_mtk: Fix potential NULL pointer dereference

+26 -7
+4 -2
drivers/staging/speakup/spk_ttyio.c
··· 265 265 return; 266 266 } 267 267 268 - speakup_tty->ops->send_xchar(speakup_tty, ch); 268 + if (speakup_tty->ops->send_xchar) 269 + speakup_tty->ops->send_xchar(speakup_tty, ch); 269 270 mutex_unlock(&speakup_tty_mutex); 270 271 } 271 272 ··· 278 277 return; 279 278 } 280 279 281 - speakup_tty->ops->tiocmset(speakup_tty, set, clear); 280 + if (speakup_tty->ops->tiocmset) 281 + speakup_tty->ops->tiocmset(speakup_tty, set, clear); 282 282 mutex_unlock(&speakup_tty_mutex); 283 283 } 284 284
+3
drivers/tty/serial/8250/8250_mtk.c
··· 357 357 if (dmacnt == 2) { 358 358 data->dma = devm_kzalloc(&pdev->dev, sizeof(*data->dma), 359 359 GFP_KERNEL); 360 + if (!data->dma) 361 + return -ENOMEM; 362 + 360 363 data->dma->fn = mtk8250_dma_filter; 361 364 data->dma->rx_size = MTK_UART_RX_SIZE; 362 365 data->dma->rxconf.src_maxburst = MTK_UART_RX_TRIGGER;
+5 -4
drivers/tty/serial/8250/8250_pci.c
··· 3420 3420 serial_pci_guess_board(struct pci_dev *dev, struct pciserial_board *board) 3421 3421 { 3422 3422 int num_iomem, num_port, first_port = -1, i; 3423 + int rc; 3424 + 3425 + rc = serial_pci_is_class_communication(dev); 3426 + if (rc) 3427 + return rc; 3423 3428 3424 3429 /* 3425 3430 * Should we try to make guesses for multiport serial devices later? ··· 3651 3646 } 3652 3647 3653 3648 board = &pci_boards[ent->driver_data]; 3654 - 3655 - rc = serial_pci_is_class_communication(dev); 3656 - if (rc) 3657 - return rc; 3658 3649 3659 3650 rc = serial_pci_is_blacklisted(dev); 3660 3651 if (rc)
+6
drivers/tty/serial/serial_core.c
··· 130 130 struct uart_port *port; 131 131 unsigned long flags; 132 132 133 + if (!state) 134 + return; 135 + 133 136 port = uart_port_lock(state, flags); 134 137 __uart_start(tty); 135 138 uart_port_unlock(port, flags); ··· 729 726 struct uart_state *state = tty->driver_data; 730 727 upstat_t mask = UPSTAT_SYNC_FIFO; 731 728 struct uart_port *port; 729 + 730 + if (!state) 731 + return; 732 732 733 733 port = uart_port_ref(state); 734 734 if (!port)
+8 -1
drivers/tty/serial/sh-sci.c
··· 1921 1921 1922 1922 static void sci_free_irq(struct sci_port *port) 1923 1923 { 1924 - int i; 1924 + int i, j; 1925 1925 1926 1926 /* 1927 1927 * Intentionally in reverse order so we iterate over the muxed ··· 1935 1935 * interrupt sources. 1936 1936 */ 1937 1937 if (unlikely(irq < 0)) 1938 + continue; 1939 + 1940 + /* Check if already freed (irq was muxed) */ 1941 + for (j = 0; j < i; j++) 1942 + if (port->irqs[j] == irq) 1943 + j = i + 1; 1944 + if (j > i) 1938 1945 continue; 1939 1946 1940 1947 free_irq(port->irqs[i], port);