dmaengine: dw-edma: Add pcim_iomap_table return check
authorGustavo Pimentel <Gustavo.Pimentel@synopsys.com>
Thu, 18 Feb 2021 19:04:09 +0000 (20:04 +0100)
committerVinod Koul <vkoul@kernel.org>
Tue, 16 Mar 2021 17:28:54 +0000 (22:58 +0530)
commit84b0aa2e0d91d7974c6cfcb3a1ce230e7366293e
treed7a3f19d6b2f181ee195b4d2eaa61352209a2c83
parentb671d098a97f59d6056b34e0a759ec976325c216
dmaengine: dw-edma: Add pcim_iomap_table return check

Currently, is missing a null check on a pcim_iomap_table() return value
and this can lead to a null pointer dereference if the desired BAR
wasn't mapped previously.
Fix this by adding a null check and returning -ENOMEM.

Addresses-Coverity: ("Dereference null return")
Signed-off-by: Gustavo Pimentel <gustavo.pimentel@synopsys.com>
Link: https://lore.kernel.org/r/bc5e6b8632c84660bb6dae454980e9419992ed14.1613674948.git.gustavo.pimentel@synopsys.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/dw-edma/dw-edma-pcie.c