hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/drivers/tty/serial/pch_uart.c
....@@ -711,6 +711,7 @@
711711 if (!chan) {
712712 dev_err(priv->port.dev, "%s:dma_request_channel FAILS(Tx)\n",
713713 __func__);
714
+ pci_dev_put(dma_dev);
714715 return;
715716 }
716717 priv->chan_tx = chan;
....@@ -727,6 +728,7 @@
727728 __func__);
728729 dma_release_channel(priv->chan_tx);
729730 priv->chan_tx = NULL;
731
+ pci_dev_put(dma_dev);
730732 return;
731733 }
732734
....@@ -734,6 +736,8 @@
734736 priv->rx_buf_virt = dma_alloc_coherent(port->dev, port->fifosize,
735737 &priv->rx_buf_dma, GFP_KERNEL);
736738 priv->chan_rx = chan;
739
+
740
+ pci_dev_put(dma_dev);
737741 }
738742
739743 static void pch_dma_rx_complete(void *arg)
....@@ -765,7 +769,7 @@
765769 }
766770 xmit->tail &= UART_XMIT_SIZE - 1;
767771 async_tx_ack(priv->desc_tx);
768
- dma_unmap_sg(port->dev, sg, priv->orig_nent, DMA_TO_DEVICE);
772
+ dma_unmap_sg(port->dev, priv->sg_tx_p, priv->orig_nent, DMA_TO_DEVICE);
769773 priv->tx_dma_use = 0;
770774 priv->nent = 0;
771775 priv->orig_nent = 0;