Skip to content

Commit 52107c5

Browse files
committed
Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Pull crypto fix from Herbert Xu: "This fixes a bug in cavium/nitrox where the callback is invoked prior to the DMA unmap" * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: crypto: cavium/nitrox - Invoke callback after DMA unmap
2 parents 44e56f3 + 356690d commit 52107c5

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

drivers/crypto/cavium/nitrox/nitrox_reqmgr.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -537,6 +537,8 @@ static void process_response_list(struct nitrox_cmdq *cmdq)
537537
struct nitrox_device *ndev = cmdq->ndev;
538538
struct nitrox_softreq *sr;
539539
int req_completed = 0, err = 0, budget;
540+
completion_t callback;
541+
void *cb_arg;
540542

541543
/* check all pending requests */
542544
budget = atomic_read(&cmdq->pending_count);
@@ -564,13 +566,13 @@ static void process_response_list(struct nitrox_cmdq *cmdq)
564566
smp_mb__after_atomic();
565567
/* remove from response list */
566568
response_list_del(sr, cmdq);
567-
568569
/* ORH error code */
569570
err = READ_ONCE(*sr->resp.orh) & 0xff;
570-
571-
if (sr->callback)
572-
sr->callback(sr->cb_arg, err);
571+
callback = sr->callback;
572+
cb_arg = sr->cb_arg;
573573
softreq_destroy(sr);
574+
if (callback)
575+
callback(cb_arg, err);
574576

575577
req_completed++;
576578
}

0 commit comments

Comments
 (0)