From: Jia-Ju Bai Date: Fri, 25 Feb 2022 12:52:30 +0000 (-0800) Subject: atm: firestream: check the return value of ioremap() in fs_init() X-Git-Tag: v4.19.236~46 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ebaa6c0e1bb18bd9d5bd26d0b1aae22d6d0f0915;p=thirdparty%2Fkernel%2Fstable.git 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 Signed-off-by: Jia-Ju Bai Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- diff --git a/drivers/atm/firestream.c b/drivers/atm/firestream.c index ef395b238816c..f7880012b9a01 100644 --- a/drivers/atm/firestream.c +++ b/drivers/atm/firestream.c @@ -1692,6 +1692,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);