bdev_get_queue(bdev)->crypto_profile;
int err = -EOPNOTSUPP;
- if (!args->err)
- return 0;
-
switch (args->op) {
case DERIVE_SW_SECRET:
err = blk_crypto_derive_sw_secret(
break;
}
args->err = err;
-
- /* Try another device in case this fails. */
- return 0;
+ return 1; /* No need to continue the iteration. */
}
static int dm_exec_wrappedkey_op(struct blk_crypto_profile *profile,
* declared on all underlying devices. Thus, all the underlying devices
* should support all wrapped key operations and they should behave
* identically, i.e. work with the same keys. So, just executing the
- * operation on the first device on which it works suffices for now.
+ * operation on the first device suffices for now.
*/
for (i = 0; i < t->num_targets; i++) {
ti = dm_table_get_target(t, i);
if (!ti->type->iterate_devices)
continue;
- ti->type->iterate_devices(ti, dm_wrappedkey_op_callback, args);
- if (!args->err)
+ if (ti->type->iterate_devices(ti, dm_wrappedkey_op_callback, args) != 0)
break;
}
out: