From: Matwey V. Kornilov Date: Thu, 29 Dec 2016 18:48:51 +0000 (+0300) Subject: serial: 8250: moxa: Store num_ports in brd X-Git-Tag: C0P2-H0.0--20200415~7308 X-Git-Url: https://git.somdevices.com/?a=commitdiff_plain;h=5d29957578aea3a5d84baf2e5d863f4f5be24222;p=linux.git serial: 8250: moxa: Store num_ports in brd [ Upstream commit 9c4b60fe5313c125b1bf68ef04b0010512c27f2d ] When struct moxa8250_board is allocated, then num_ports should be initialized in order to use it later in moxa8250_remove. Signed-off-by: Matwey V. Kornilov Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/tty/serial/8250/8250_moxa.c b/drivers/tty/serial/8250/8250_moxa.c index 26eb5393a263..d5069b2d4d79 100644 --- a/drivers/tty/serial/8250/8250_moxa.c +++ b/drivers/tty/serial/8250/8250_moxa.c @@ -68,6 +68,7 @@ static int moxa8250_probe(struct pci_dev *pdev, const struct pci_device_id *id) sizeof(unsigned int) * nr_ports, GFP_KERNEL); if (!brd) return -ENOMEM; + brd->num_ports = nr_ports; memset(&uart, 0, sizeof(struct uart_8250_port));