]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
IB/hfi1: Fix potential panic with sdma drained mechanism
authorMike Marciniszyn <mike.marciniszyn@intel.com>
Thu, 12 May 2016 17:23:03 +0000 (10:23 -0700)
committerDoug Ledford <dledford@redhat.com>
Fri, 13 May 2016 23:39:16 +0000 (19:39 -0400)
The guard is backwards, potentially causing the SDMA client
to panic if a wait structure was not specified.

psm and verbs are not exposed to the issue, but fix the
code just to be correct.

Fixes: a545f5308b6c ("staging/rdma/hfi: fix CQ completion order issue")
Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/staging/rdma/hfi1/sdma.c

index abb8ebc1fcac9060032e6accc74df34645f2276d..e938017f78e36d0eeade9d06953360cadbd437b7 100644 (file)
@@ -376,7 +376,7 @@ static inline void complete_tx(struct sdma_engine *sde,
        sdma_txclean(sde->dd, tx);
        if (complete)
                (*complete)(tx, res);
-       if (iowait_sdma_dec(wait) && wait)
+       if (wait && iowait_sdma_dec(wait))
                iowait_drain_wakeup(wait);
 }