8250_lpss: check null return when calling pci_ioremap_bar
authorNavid Emamdoost <navid.emamdoost@gmail.com>
Fri, 19 Jul 2019 17:48:45 +0000 (12:48 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 4 Sep 2019 10:43:45 +0000 (12:43 +0200)
commitea5ab2e422de0ef0fc476fe40f0829abe72684cd
tree1005ffafb483661ab58c0d5f17a819b9c52f4772
parentf77ebb241ce00ec99ed4e42ff3ab38dd6d1ce6f5
8250_lpss: check null return when calling pci_ioremap_bar

pci_ioremap_bar may return null. This is eventually de-referenced at
drivers/dma/dw/core.c:1154 and drivers/dma/dw/core.c:1168. A null check
is needed to prevent null de-reference. I am adding the check and in
case of failure. Thanks to Andy Shevchenko for the hint on the necessity
of pci_iounmap when exiting.

Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20190719174848.24216-1-navid.emamdoost@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/8250/8250_lpss.c