Skip to content

Commit

Permalink
ata: pata_isapnp: Add missing error check for devm_ioport_map()
Browse files Browse the repository at this point in the history
[ Upstream commit a692516 ]

Add missing error return check for devm_ioport_map() and return the
error if this function call fails.

Fixes: 0d5ff56 ("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>
  • Loading branch information
Chen Ni authored and gregkh committed Dec 3, 2023
1 parent 8da4a34 commit 6fdfac3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/ata/pata_isapnp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 6fdfac3

Please sign in to comment.