summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2021-06-12 12:27:05 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2021-06-12 12:27:05 -0700
commitc46fe4aa8271e97b520dc72018688e083460127c (patch)
treeb6f95d192a07eccbfeede763714c93dbdb737208 /drivers
parent0d50658834f9f655559f07ee61f227c435d8e481 (diff)
parent7c3e8d9df265bd0bdf6e328174cdfba26eb22f1c (diff)
downloadlinux-c46fe4aa8271e97b520dc72018688e083460127c.tar.bz2
Merge tag 'tty-5.13-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty
Pull serial driver fix from Greg KH: "A single 8250_exar serial driver fix for a reported problem with a change that happened in 5.13-rc1. It has been in linux-next with no reported problems" * tag 'tty-5.13-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: serial: 8250_exar: Avoid NULL pointer dereference at ->exit()
Diffstat (limited to 'drivers')
-rw-r--r--drivers/tty/serial/8250/8250_exar.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/tty/serial/8250/8250_exar.c b/drivers/tty/serial/8250/8250_exar.c
index 2f49c580139b..bd4e9f6ac29c 100644
--- a/drivers/tty/serial/8250/8250_exar.c
+++ b/drivers/tty/serial/8250/8250_exar.c
@@ -553,7 +553,11 @@ static void pci_xr17v35x_exit(struct pci_dev *pcidev)
{
struct exar8250 *priv = pci_get_drvdata(pcidev);
struct uart_8250_port *port = serial8250_get_port(priv->line[0]);
- struct platform_device *pdev = port->port.private_data;
+ struct platform_device *pdev;
+
+ pdev = port->port.private_data;
+ if (!pdev)
+ return;
device_remove_software_node(&pdev->dev);
platform_device_unregister(pdev);