Re: [PATCH v4 1/2] crypto: caam - Fix wrong unmap operations
From: Sahil Malhotra
Date: Thu Nov 12 2026 - 02:52:51 EST
On Thu, Nov 12, 2026 at 10:02:20AM +1100, Changwei Zou wrote:
> Since priv_form only takes values FORM1/FORM2/FORM3 with no distinct
> public key enumerator, rsa_pub_unmap() was not called correctly in
> akcipher_do_one_req() and akcipher_enqueue_req().
>
> Use the completion callback (rsa_pub_done vs rsa_priv_f_done) to
> distinguish public from private key operations, then dispatch to the
> correct unmap function based on key->priv_form.
Hi Changwei,
[...]
> + if (req_ctx->akcipher_op_done == rsa_pub_done) {
> + rsa_pub_unmap(jrdev, req_ctx->edesc, req);
> + } else {
> + switch (key->priv_form) {
Nit (not blocking): this public/FORM1/FORM2/FORM3 dispatch is now
open-coded twice (here and in akcipher_enqueue_req()). A small
helper, e.g. rsa_pdb_unmap(dev, edesc, req, cbk), would keep both
paths in sync.
Thanks,
Sahil