mirror of
https://github.com/torvalds/linux.git
synced 2024-12-11 13:41:55 +00:00
crypto: qat - fix crypto_get_instance_node function
qat_crypto_get_instance_node function needs to handle situation when the first dev in the list is not started. Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
parent
f02b7d0c7b
commit
4a4b0bad06
@ -118,11 +118,23 @@ struct qat_crypto_instance *qat_crypto_get_instance_node(int node)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!accel_dev) {
|
if (!accel_dev)
|
||||||
pr_err("QAT: Could not find a device on node %d\n", node);
|
pr_info("QAT: Could not find a device on node %d\n", node);
|
||||||
accel_dev = adf_devmgr_get_first();
|
|
||||||
|
/* 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 (adf_dev_started(tmp_dev) &&
|
||||||
|
!list_empty(&tmp_dev->crypto_list)) {
|
||||||
|
accel_dev = tmp_dev;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (!accel_dev || !adf_dev_started(accel_dev))
|
|
||||||
|
if (!accel_dev)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
best = ~0;
|
best = ~0;
|
||||||
|
Loading…
Reference in New Issue
Block a user