Skip to content

Commit

Permalink
Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git…
Browse files Browse the repository at this point in the history
…/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
  • Loading branch information
Linus Torvalds committed Feb 1, 2019
2 parents 44e56f3 + 356690d commit 52107c5
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions drivers/crypto/cavium/nitrox/nitrox_reqmgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,8 @@ static void process_response_list(struct nitrox_cmdq *cmdq)
struct nitrox_device *ndev = cmdq->ndev;
struct nitrox_softreq *sr;
int req_completed = 0, err = 0, budget;
completion_t callback;
void *cb_arg;

/* check all pending requests */
budget = atomic_read(&cmdq->pending_count);
Expand Down Expand Up @@ -564,13 +566,13 @@ static void process_response_list(struct nitrox_cmdq *cmdq)
smp_mb__after_atomic();
/* remove from response list */
response_list_del(sr, cmdq);

/* ORH error code */
err = READ_ONCE(*sr->resp.orh) & 0xff;

if (sr->callback)
sr->callback(sr->cb_arg, err);
callback = sr->callback;
cb_arg = sr->cb_arg;
softreq_destroy(sr);
if (callback)
callback(cb_arg, err);

req_completed++;
}
Expand Down

0 comments on commit 52107c5

Please sign in to comment.