]> git.baikalelectronics.ru Git - kernel.git/commit
serial: sprd: Fix a dereference warning
authorLanqing Liu <liuhhome@gmail.com>
Mon, 16 Mar 2020 03:13:33 +0000 (11:13 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 17 Mar 2020 14:20:41 +0000 (15:20 +0100)
commita18c40264add8260d933b18561f3b0578a35fac1
tree36b6beab03b26fc1463f2adb49db26da816ee233
parent51ce1163549cfdf1467347a86775b389519d258b
serial: sprd: Fix a dereference warning

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: 92147b6714fe ("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