LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] PCI: ibmphp: Fix double unmap of io_mem
@ 2021-08-18 16:57 Vishal Aslot
  2021-09-02 17:05 ` Bjorn Helgaas
  0 siblings, 1 reply; 2+ messages in thread
From: Vishal Aslot @ 2021-08-18 16:57 UTC (permalink / raw)
  To: Bjorn Helgaas; +Cc: linux-pci, linux-kernel, Vishal Aslot

ebda_rsrc_controller() calls iounmap(io_mem) on the error path. It's
caller, ibmphp_access_ebda() also calls iounmap(io_mem) on good and
error paths. Removing the iounmap(io_mem) invocation inside
ebda_rsrc_controller().

Signed-off-by: Vishal Aslot <os.vaslot@gmail.com>
---

Why am I fixing this?
I found this clean up item in drivers/pci/hotplug/TODO [lines 43-44]
and decided to fix it. This is my 2nd patch ever in linux so my
apologies for any style issues. I am very teachable. :)

 drivers/pci/hotplug/ibmphp_ebda.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/pci/hotplug/ibmphp_ebda.c b/drivers/pci/hotplug/ibmphp_ebda.c
index 11a2661dc062..7fb75401ad8a 100644
--- a/drivers/pci/hotplug/ibmphp_ebda.c
+++ b/drivers/pci/hotplug/ibmphp_ebda.c
@@ -714,8 +714,7 @@ static int __init ebda_rsrc_controller(void)
 		/* init hpc structure */
 		hpc_ptr = alloc_ebda_hpc(slot_num, bus_num);
 		if (!hpc_ptr) {
-			rc = -ENOMEM;
-			goto error_no_hpc;
+			return -ENOMEM;
 		}
 		hpc_ptr->ctlr_id = ctlr_id;
 		hpc_ptr->ctlr_relative_id = ctlr;
@@ -910,8 +909,6 @@ static int __init ebda_rsrc_controller(void)
 	kfree(tmp_slot);
 error_no_slot:
 	free_ebda_hpc(hpc_ptr);
-error_no_hpc:
-	iounmap(io_mem);
 	return rc;
 }
 
-- 
2.27.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-09-02 17:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-18 16:57 [PATCH] PCI: ibmphp: Fix double unmap of io_mem Vishal Aslot
2021-09-02 17:05 ` Bjorn Helgaas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).