From patchwork Thu Jul 1 20:25:45 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ralph Campbell X-Patchwork-Id: 109380 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o61KPl8q007315 for ; Thu, 1 Jul 2010 20:26:18 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754772Ab0GAUZq (ORCPT ); Thu, 1 Jul 2010 16:25:46 -0400 Received: from vpn.pathscale.com ([198.186.3.75]:43220 "HELO mx.mv.qlogic.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with SMTP id S1752037Ab0GAUZq (ORCPT ); Thu, 1 Jul 2010 16:25:46 -0400 Received: from chromite.mv.qlogic.com (chromite.mv.qlogic.com [10.29.2.82]) by mx.mv.qlogic.com (Postfix) with ESMTP id 30EAA14308B5; Thu, 1 Jul 2010 13:25:45 -0700 (PDT) Received: from chromite.mv.qlogic.com (localhost.localdomain [127.0.0.1]) by chromite.mv.qlogic.com (Postfix) with ESMTP id 2E742142943; Thu, 1 Jul 2010 13:25:45 -0700 (PDT) From: Ralph Campbell Subject: [PATCH] IB/qib: if qib_init() fails, driver fails to clean up properly To: Roland Dreier Cc: linux-rdma@vger.kernel.org Date: Thu, 01 Jul 2010 13:25:45 -0700 Message-ID: <20100701202544.17064.62649.stgit@chromite.mv.qlogic.com> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Thu, 01 Jul 2010 20:26:19 +0000 (UTC) diff --git a/drivers/infiniband/hw/qib/qib_init.c b/drivers/infiniband/hw/qib/qib_init.c index 7831ff8..a873dd5 100644 --- a/drivers/infiniband/hw/qib/qib_init.c +++ b/drivers/infiniband/hw/qib/qib_init.c @@ -1289,8 +1289,18 @@ static int __devinit qib_init_one(struct pci_dev *pdev, if (qib_mini_init || initfail || ret) { qib_stop_timers(dd); + flush_scheduled_work(); for (pidx = 0; pidx < dd->num_pports; ++pidx) dd->f_quiet_serdes(dd->pport + pidx); + if (qib_mini_init) + goto bail; + if (!j) { + (void) qibfs_remove(dd); + qib_device_remove(dd); + } + if (!ret) + qib_unregister_ib_device(dd); + qib_postinit_cleanup(dd); if (initfail) ret = initfail; goto bail;