tty: atmel_serial: fix a potential NULL pointer dereference
authorKangjie Lu <kjlu@umn.edu>
Fri, 15 Mar 2019 17:16:06 +0000 (12:16 -0500)
committerBen Hutchings <ben@decadent.org.uk>
Tue, 13 Aug 2019 11:38:46 +0000 (12:38 +0100)
commitcf592ae629558dba003094192c667c74f4cc670c
treec25b3fb09995a83a239229574f8e6008627655bc
parent22230045cf8128435150a12d0b4ee4c41311600d
tty: atmel_serial: fix a potential NULL pointer dereference

commit c85be041065c0be8bc48eda4c45e0319caf1d0e5 upstream.

In case dmaengine_prep_dma_cyclic fails, the fix returns a proper
error code to avoid NULL pointer dereference.

Signed-off-by: Kangjie Lu <kjlu@umn.edu>
Fixes: 34df42f59a60 ("serial: at91: add rx dma support")
Acked-by: Richard Genoud <richard.genoud@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[bwh: Backported to 3.16: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/tty/serial/atmel_serial.c