mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
serial: 8250_mid: Balance reference count for PCI DMA device
[ Upstream commit 67ec6dd0b257bd81b4e9fcac89b29da72f6265e5 ] The pci_get_slot() increases its reference count, the caller must decrement the reference count by calling pci_dev_put(). Fixes: 90b9aacf912a ("serial: 8250_pci: add Intel Tangier support") Fixes: f549e94effa1 ("serial: 8250_pci: add Intel Penwell ports") Reported-by: Qing Wang <wangqing@vivo.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Depends-on: d9eda9bab237 ("serial: 8250_pci: Intel MID UART support to its own driver") Link: https://lore.kernel.org/r/20220215100920.41984-1-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
96219d36fe
commit
1345af488a
@ -75,6 +75,11 @@ static int pnw_setup(struct mid8250 *mid, struct uart_port *p)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void pnw_exit(struct mid8250 *mid)
|
||||
{
|
||||
pci_dev_put(mid->dma_dev);
|
||||
}
|
||||
|
||||
static int tng_handle_irq(struct uart_port *p)
|
||||
{
|
||||
struct mid8250 *mid = p->private_data;
|
||||
@ -126,6 +131,11 @@ static int tng_setup(struct mid8250 *mid, struct uart_port *p)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void tng_exit(struct mid8250 *mid)
|
||||
{
|
||||
pci_dev_put(mid->dma_dev);
|
||||
}
|
||||
|
||||
static int dnv_handle_irq(struct uart_port *p)
|
||||
{
|
||||
struct mid8250 *mid = p->private_data;
|
||||
@ -332,9 +342,9 @@ static int mid8250_probe(struct pci_dev *pdev, const struct pci_device_id *id)
|
||||
|
||||
pci_set_drvdata(pdev, mid);
|
||||
return 0;
|
||||
|
||||
err:
|
||||
if (mid->board->exit)
|
||||
mid->board->exit(mid);
|
||||
mid->board->exit(mid);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -344,8 +354,7 @@ static void mid8250_remove(struct pci_dev *pdev)
|
||||
|
||||
serial8250_unregister_port(mid->line);
|
||||
|
||||
if (mid->board->exit)
|
||||
mid->board->exit(mid);
|
||||
mid->board->exit(mid);
|
||||
}
|
||||
|
||||
static const struct mid8250_board pnw_board = {
|
||||
@ -353,6 +362,7 @@ static const struct mid8250_board pnw_board = {
|
||||
.freq = 50000000,
|
||||
.base_baud = 115200,
|
||||
.setup = pnw_setup,
|
||||
.exit = pnw_exit,
|
||||
};
|
||||
|
||||
static const struct mid8250_board tng_board = {
|
||||
@ -360,6 +370,7 @@ static const struct mid8250_board tng_board = {
|
||||
.freq = 38400000,
|
||||
.base_baud = 1843200,
|
||||
.setup = tng_setup,
|
||||
.exit = tng_exit,
|
||||
};
|
||||
|
||||
static const struct mid8250_board dnv_board = {
|
||||
|
Loading…
x
Reference in New Issue
Block a user