diff options
author | Tadeusz Struk <tadeusz.struk@intel.com> | 2015-10-22 06:30:36 -0700 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2015-11-17 21:58:36 +0800 |
commit | d956fed7b68fa1713b7ad0d8e100824cc55afce8 (patch) | |
tree | bc6ff7bf6ee0af82feb93295dd69c16321db883b /drivers/crypto/qat/qat_common/qat_crypto.c | |
parent | 16f56e8b751f72e0e105abc1d8f5912c340a5623 (diff) | |
download | op-kernel-dev-d956fed7b68fa1713b7ad0d8e100824cc55afce8.zip op-kernel-dev-d956fed7b68fa1713b7ad0d8e100824cc55afce8.tar.gz |
crypto: qat - fix get instance function
Fix the logic in case we have found a device on a given node.
Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/qat/qat_common/qat_crypto.c')
-rw-r--r-- | drivers/crypto/qat/qat_common/qat_crypto.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/crypto/qat/qat_common/qat_crypto.c b/drivers/crypto/qat/qat_common/qat_crypto.c index 9cab154..9425402 100644 --- a/drivers/crypto/qat/qat_common/qat_crypto.c +++ b/drivers/crypto/qat/qat_common/qat_crypto.c @@ -118,19 +118,19 @@ struct qat_crypto_instance *qat_crypto_get_instance_node(int node) } } } - if (!accel_dev) - pr_info("QAT: Could not find a device on node %d\n", node); - - /* Get any started device */ - list_for_each(itr, adf_devmgr_get_head()) { - struct adf_accel_dev *tmp_dev; - tmp_dev = list_entry(itr, struct adf_accel_dev, list); + if (!accel_dev) { + pr_info("QAT: Could not find a device on node %d\n", node); + /* Get any started device */ + list_for_each(itr, adf_devmgr_get_head()) { + struct adf_accel_dev *tmp_dev; - if (adf_dev_started(tmp_dev) && - !list_empty(&tmp_dev->crypto_list)) { - accel_dev = tmp_dev; - break; + tmp_dev = list_entry(itr, struct adf_accel_dev, list); + if (adf_dev_started(tmp_dev) && + !list_empty(&tmp_dev->crypto_list)) { + accel_dev = tmp_dev; + break; + } } } |