From patchwork Fri Apr 27 15:16:53 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiang Liu X-Patchwork-Id: 155512 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 6FDF1B6FA5 for ; Sat, 28 Apr 2012 01:24:28 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932267Ab2D0PVw (ORCPT ); Fri, 27 Apr 2012 11:21:52 -0400 Received: from mail-pb0-f46.google.com ([209.85.160.46]:61293 "EHLO mail-pb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932261Ab2D0PVt (ORCPT ); Fri, 27 Apr 2012 11:21:49 -0400 Received: by mail-pb0-f46.google.com with SMTP id rp8so666347pbb.19 for ; Fri, 27 Apr 2012 08:21:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=54HkgIic6GiT51XNdviC3gVs2rNsTIph12WrTWUioAg=; b=Ye0NEnxg5uHd6cAziQ2PwCycyaHFbxdjRdGq4BrEvibHDCv/UIiQUq8ToUQUbIc9za EbkmAhCO1hTe1Wqu1YLgC0z++FAOTKWcBHtn+El4E94Y7M3BX+Km88UYF9h5x1GhQZaE gv7Se8L1xhFI4h3cFOole3cdpTo82quj/Qno7fzV+5qoj88rpCGdU6qWzRifuc54Q12q +SBi9XKoP2ACpAsD2DdyTn4WgWlktF5fK6f8uFTRjl6D6fexoyM1QxTqi8pk4/aZ9tGk lfGhTRtOKWfFzwTw5VttPICRMl1iO/bFgeZjA9f+Odjw1RrlL8anGeUUPH50M3QMRycm Wizw== Received: by 10.68.75.45 with SMTP id z13mr12476110pbv.100.1335540109622; Fri, 27 Apr 2012 08:21:49 -0700 (PDT) Received: from localhost.localdomain ([221.221.26.142]) by mx.google.com with ESMTPS id 2sm6743917pbw.57.2012.04.27.08.21.40 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 27 Apr 2012 08:21:48 -0700 (PDT) From: Jiang Liu To: Yinghai Lu , Kenji Kaneshige , Bjorn Helgaas , Don Dutile , Greg KH Cc: Jiang Liu , Keping Chen , linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, Jiang Liu Subject: [PATCH v2 12/19] PCI: clean up all resources in error handling path in zt5550_hc_init_one() Date: Fri, 27 Apr 2012 23:16:53 +0800 Message-Id: <1335539820-11232-13-git-send-email-jiang.liu@huawei.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1335539820-11232-1-git-send-email-jiang.liu@huawei.com> References: <1335539820-11232-1-git-send-email-jiang.liu@huawei.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org From: Jiang Liu Clean up all resources in error handling path in function zt5550_hc_init_one(). Signed-off-by: Jiang Liu --- drivers/pci/hotplug/cpcihp_zt5550.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/drivers/pci/hotplug/cpcihp_zt5550.c b/drivers/pci/hotplug/cpcihp_zt5550.c index 6bf8d2a..8a6f968 100644 --- a/drivers/pci/hotplug/cpcihp_zt5550.c +++ b/drivers/pci/hotplug/cpcihp_zt5550.c @@ -257,11 +257,13 @@ static int zt5550_hc_init_one (struct pci_dev *pdev, const struct pci_device_id if(status != 0) { err("could not started cPCI hotplug system"); cpci_hp_unregister_bus(bus0); - goto init_register_error; + goto init_start_error; } dbg("started cpci hp system"); return 0; +init_start_error: + cpci_hp_unregister_bus(bus0); init_register_error: cpci_hp_unregister_controller(&zt5550_hpc); init_hc_error: