summaryrefslogtreecommitdiff
path: root/drivers/atm
diff options
context:
space:
mode:
authorJia-Ju Bai <baijiaju1990@gmail.com>2022-02-25 15:52:30 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-03-19 15:47:49 +0300
commit4051516d4b7944c68095c09002f4da00e0a664ce (patch)
tree809cb4a7b232f2fe66a8f0c57f35b0c6d514161e /drivers/atm
parent76e0b8e12c64637adf6083278345b347bfa6fc6b (diff)
downloadlinux-4051516d4b7944c68095c09002f4da00e0a664ce.tar.xz
atm: firestream: check the return value of ioremap() in fs_init()
[ Upstream commit d4e26aaea7f82ba884dcb4acfe689406bc092dc3 ] The function ioremap() in fs_init() can fail, so its return value should be checked. Reported-by: TOTE Robot <oslab@tsinghua.edu.cn> Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/atm')
-rw-r--r--drivers/atm/firestream.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/atm/firestream.c b/drivers/atm/firestream.c
index 3bc3c314a467..4f67404fe64c 100644
--- a/drivers/atm/firestream.c
+++ b/drivers/atm/firestream.c
@@ -1676,6 +1676,8 @@ static int fs_init(struct fs_dev *dev)
dev->hw_base = pci_resource_start(pci_dev, 0);
dev->base = ioremap(dev->hw_base, 0x1000);
+ if (!dev->base)
+ return 1;
reset_chip (dev);