crypto: msm: qcrypto: fix crash in _qcrypto_tfm_complete
_qcrypto_tfm_complete calls a user completion function and if it's the user's last request, cra_exit may be called to destroy the tfm context. The tfm context is no longer valid, and referring to the deleted tfm context after the callback is invoked may cause a crash. The solution is to look ahead to ensure that there are more entries in the response queue to process before calling the user completion callback. If there are no more entries to process after the callback is invoked, it won't proceed to look at tfm for additional completed responses to process. Change-Id: I71367bd6ef4131e8e31f03d7cc6bece16e8957e7 Acked-by:Chemin Hsieh <cheminh@qti.qualcomm.com> Signed-off-by:
Zhen Kong <zkong@codeaurora.org>
Loading
Please register or sign in to comment