projects
/
wrapfs-3.14.y.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8f36778
)
serial: sprd: Fix a dereference warning
author
Lanqing Liu
<liuhhome@gmail.com>
Mon, 16 Mar 2020 03:13:33 +0000
(11:13 +0800)
committer
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Thu, 2 Apr 2020 13:09:51 +0000
(15:09 +0200)
commit
efc176929a3505a30c3993ddd393b40893649bd2
upstream.
We should validate if the 'sup' is NULL or not before freeing DMA
memory, to fix below warning.
"drivers/tty/serial/sprd_serial.c:1141 sprd_remove()
error: we previously assumed 'sup' could be null (see line 1132)"
Fixes: f4487db58eb7 ("serial: sprd: Add DMA mode support")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Lanqing Liu <liuhhome@gmail.com>
Cc: stable <stable@vger.kernel.org>
Link:
https://lore.kernel.org/r/e2bd92691538e95b04a2c2a728f3292e1617018f.1584325957.git.liuhhome@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/sprd_serial.c
patch
|
blob
|
history
diff --git
a/drivers/tty/serial/sprd_serial.c
b/drivers/tty/serial/sprd_serial.c
index f60a59d9bf271074dfde293a695ea0d8558e91c9..685041d14e0124fcc33746a425770d91790f8f7a 100644
(file)
--- a/
drivers/tty/serial/sprd_serial.c
+++ b/
drivers/tty/serial/sprd_serial.c
@@
-1136,14
+1136,13
@@
static int sprd_remove(struct platform_device *dev)
if (sup) {
uart_remove_one_port(&sprd_uart_driver, &sup->port);
sprd_port[sup->port.line] = NULL;
+ sprd_rx_free_buf(sup);
sprd_ports_num--;
}
if (!sprd_ports_num)
uart_unregister_driver(&sprd_uart_driver);
- sprd_rx_free_buf(sup);
-
return 0;
}