IB/hfi1: Change hfi1_init loop to preserve error returns
authorAshutosh Dixit <ashutosh.dixit@intel.com>
Thu, 12 May 2016 17:24:00 +0000 (10:24 -0700)
committerDoug Ledford <dledford@redhat.com>
Fri, 13 May 2016 23:39:19 +0000 (19:39 -0400)
commit3923979e9bc6aa6f168a644314d6729e9f98eccc
tree356ca691959c9202662d020d2b2b3fa7b0e0c6a6
parentbf77cc34f3e6905bc8841489dd628bbffe37d743
IB/hfi1: Change hfi1_init loop to preserve error returns

If one iteration of the loop causes an error return and a later iteration
doesn't, the later iteration causes the earlier error condition to be
lost. This could result in driver probe succeeding when it should have
failed. Therefore save off the error return in the loop itself rather than
outside the loop.

Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Reviewed-by: Mitko Haralanov <mitko.haralanov@intel.com>
Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/staging/rdma/hfi1/init.c