Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f336aa92 authored by Vishal Aslot's avatar Vishal Aslot Committed by Greg Kroah-Hartman
Browse files

PCI: ibmphp: Fix double unmap of io_mem

[ Upstream commit faa2e05ad0dccf37f995bcfbb8d1980d66c02c11 ]

ebda_rsrc_controller() calls iounmap(io_mem) on the error path. Its caller,
ibmphp_access_ebda(), also calls iounmap(io_mem) on good and error paths.

Remove the iounmap(io_mem) invocation from ebda_rsrc_controller().

[bhelgaas: remove item from TODO]
Link: https://lore.kernel.org/r/20210818165751.591185-1-os.vaslot@gmail.com


Signed-off-by: default avatarVishal Aslot <os.vaslot@gmail.com>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 0f9550c4
Loading
Loading
Loading
Loading
+0 −3
Original line number Original line Diff line number Diff line
@@ -40,9 +40,6 @@ ibmphp:


* The return value of pci_hp_register() is not checked.
* The return value of pci_hp_register() is not checked.


* iounmap(io_mem) is called in the error path of ebda_rsrc_controller()
  and once more in the error path of its caller ibmphp_access_ebda().

* The various slot data structures are difficult to follow and need to be
* The various slot data structures are difficult to follow and need to be
  simplified.  A lot of functions are too large and too complex, they need
  simplified.  A lot of functions are too large and too complex, they need
  to be broken up into smaller, manageable pieces.  Negative examples are
  to be broken up into smaller, manageable pieces.  Negative examples are
+1 −4
Original line number Original line Diff line number Diff line
@@ -714,8 +714,7 @@ static int __init ebda_rsrc_controller(void)
		/* init hpc structure */
		/* init hpc structure */
		hpc_ptr = alloc_ebda_hpc(slot_num, bus_num);
		hpc_ptr = alloc_ebda_hpc(slot_num, bus_num);
		if (!hpc_ptr) {
		if (!hpc_ptr) {
			rc = -ENOMEM;
			return -ENOMEM;
			goto error_no_hpc;
		}
		}
		hpc_ptr->ctlr_id = ctlr_id;
		hpc_ptr->ctlr_id = ctlr_id;
		hpc_ptr->ctlr_relative_id = ctlr;
		hpc_ptr->ctlr_relative_id = ctlr;
@@ -910,8 +909,6 @@ static int __init ebda_rsrc_controller(void)
	kfree(tmp_slot);
	kfree(tmp_slot);
error_no_slot:
error_no_slot:
	free_ebda_hpc(hpc_ptr);
	free_ebda_hpc(hpc_ptr);
error_no_hpc:
	iounmap(io_mem);
	return rc;
	return rc;
}
}