diff options
author | Chen Ni | 2023-10-31 04:00:07 +0000 |
---|---|---|
committer | Greg Kroah-Hartman | 2023-12-03 07:32:07 +0100 |
commit | 84c9d30dbc0e2c6f963314fb0a4a258736dea7f8 (patch) | |
tree | cdad92607992aec4c91acb4defd908108bb142c5 | |
parent | cfbdb367277e3935e3b4da412d8528df640c36c5 (diff) |
ata: pata_isapnp: Add missing error check for devm_ioport_map()
[ Upstream commit a6925165ea82b7765269ddd8dcad57c731aa00de ]
Add missing error return check for devm_ioport_map() and return the
error if this function call fails.
Fixes: 0d5ff566779f ("libata: convert to iomap")
Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r-- | drivers/ata/pata_isapnp.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/ata/pata_isapnp.c b/drivers/ata/pata_isapnp.c index 43bb224430d3..8892931ea867 100644 --- a/drivers/ata/pata_isapnp.c +++ b/drivers/ata/pata_isapnp.c @@ -82,6 +82,9 @@ static int isapnp_init_one(struct pnp_dev *idev, const struct pnp_device_id *dev if (pnp_port_valid(idev, 1)) { ctl_addr = devm_ioport_map(&idev->dev, pnp_port_start(idev, 1), 1); + if (!ctl_addr) + return -ENOMEM; + ap->ioaddr.altstatus_addr = ctl_addr; ap->ioaddr.ctl_addr = ctl_addr; ap->ops = &isapnp_port_ops; |