IB/qib: Fix debugfs ordering issue with multiple HCAs
authorMike Marciniszyn <mike.marciniszyn@intel.com>
Fri, 7 Mar 2014 13:32:31 +0000 (08:32 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 6 May 2014 14:59:28 +0000 (07:59 -0700)
commit88e2517ceb1bdb4e19559109d247f068f6d6eea6
tree383e514a3faa99ab4ca4ac2230fe73bd243e413f
parentb1bb4fbfcb79809874aab591bc1bdff09ca69189
IB/qib: Fix debugfs ordering issue with multiple HCAs

commit f8b6c47a44c063062317646683a73371c24c69ee upstream.

The debugfs init code was incorrectly called before the idr mechanism
is used to get the unit number, so the dd->unit hasn't been
initialized.  This caused the unit relative directory creation to fail
after the first.

This patch moves the init for the debugfs stuff until after all of the
failures and after the unit number has been determined.

A bug in unwind code in qib_alloc_devdata() is also fixed.

Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/infiniband/hw/qib/qib_init.c