Skip to content

Commit a692516

Browse files
Chen Nidamien-lemoal
authored andcommitted
ata: pata_isapnp: Add missing error check for devm_ioport_map()
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 <[email protected]> Reviewed-by: Sergey Shtylyov <[email protected]> Signed-off-by: Damien Le Moal <[email protected]>
1 parent 98b1cc8 commit a692516

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/ata/pata_isapnp.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ static int isapnp_init_one(struct pnp_dev *idev, const struct pnp_device_id *dev
8282
if (pnp_port_valid(idev, 1)) {
8383
ctl_addr = devm_ioport_map(&idev->dev,
8484
pnp_port_start(idev, 1), 1);
85+
if (!ctl_addr)
86+
return -ENOMEM;
87+
8588
ap->ioaddr.altstatus_addr = ctl_addr;
8689
ap->ioaddr.ctl_addr = ctl_addr;
8790
ap->ops = &isapnp_port_ops;

0 commit comments

Comments
 (0)