From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 20812C433F5 for ; Sat, 11 Sep 2021 13:16:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0D93461206 for ; Sat, 11 Sep 2021 13:16:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236349AbhIKNRM (ORCPT ); Sat, 11 Sep 2021 09:17:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:41214 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236858AbhIKNPM (ORCPT ); Sat, 11 Sep 2021 09:15:12 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9DAA461216; Sat, 11 Sep 2021 13:13:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1631365986; bh=MznIBEeT4uqOL6YVdEqOi56t+PHKc+D+hfPTw/tzeNA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GbKUGI4vZqWdhJ0WZxPNhMGoXRnCvbsLL4HK4W+aA3zrcf6FPhVChdlLdlTlihJ8A 3LD6/SbI8+TrHvf8O0kMRs8yVPCPt9/BMbMGbY0u7aJuAGzsnQpPp69JT1ZhOzbHmU 7FFifNiFzrTVroWxAjnlQqS6XApeoClYn4xPNNczs97KkAdk+LLj0w/wzRA0MwZUZn l6y/ylTgCoGzDzDL7eJGHVZBJe/N2BSAI9WjdqKFDUEw3v693TXOLl76Q0i9ejCdmc HE5YcHbSmL4eVXn/ocCr5KahIXIZ7K8TzfelbE3KF8itm6r7Q5qOwmIdQRb0/baNeg QDFUXTuwT39Zg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Vishal Aslot , Bjorn Helgaas , Sasha Levin , linux-pci@vger.kernel.org Subject: [PATCH AUTOSEL 5.13 25/29] PCI: ibmphp: Fix double unmap of io_mem Date: Sat, 11 Sep 2021 09:12:29 -0400 Message-Id: <20210911131233.284800-25-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210911131233.284800-1-sashal@kernel.org> References: <20210911131233.284800-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Vishal Aslot [ 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: Vishal Aslot Signed-off-by: Bjorn Helgaas Signed-off-by: Sasha Levin --- drivers/pci/hotplug/TODO | 3 --- drivers/pci/hotplug/ibmphp_ebda.c | 5 +---- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/pci/hotplug/TODO b/drivers/pci/hotplug/TODO index a32070be5adf..cc6194aa24c1 100644 --- a/drivers/pci/hotplug/TODO +++ b/drivers/pci/hotplug/TODO @@ -40,9 +40,6 @@ ibmphp: * 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 simplified. A lot of functions are too large and too complex, they need to be broken up into smaller, manageable pieces. Negative examples are 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.30.2