Skip to contentSkip to conversation

atm: firestream: check the return value of ioremap() in fs_init()

PATCH Applied Jia-Ju Bai 2 participants 2 messages Feb 25, 2022 – Feb 28, 2022

Subsystems (3)
lore
Share & tools
lore

Jia-Ju Bai

author
#0 lore raw

PATCH 1/1 atm: firestream: check the return value of ioremap() in fs_init()

The function ioremap() in fs_init() can fail, so its return value should be checked.

---
 drivers/atm/firestream.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/atm/firestream.c +2 -0
index 3bc3c314a467..4f67404fe64c 100644
@@ -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);
   
Signature · 1 line
2.17.1
#1 lore raw
This patch was applied to netdev/net.git (master) by David S. Miller <[email protected]>:

Hello:

This patch was applied to netdev/net.git (master)
by David S. Miller <[email protected]>:

Quoted 8 lines · On Fri, 25 Feb 2022 04:52:30 -0800 you wrote:

The function ioremap() in fs_init() can fail, so its return value should be checked.

---
 drivers/atm/firestream.c | 2 ++
 1 file changed, 2 insertions(+)

Here is the summary with links:
- atm: firestream: check the return value of ioremap() in fs_init()

    https://git.kernel.org/netdev/net/c/d4e26aaea7f8

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html