Parcourir la source

qcedev: Fix null-ptr-deref in qcedev_cipher_req_cb

adding missing NULL check for qcedev_areq in
qcedev_offload_cipher_req_cb and qcedev_cipher_req_cb.

Change-Id: Ibbb037b12b1c6264376fe1f3185bd0b392447a65
Signed-off-by: Udit Tiwari <[email protected]>
Udit Tiwari il y a 1 an
Parent
commit
48d10387ac
1 fichiers modifiés avec 2 ajouts et 2 suppressions
  1. 2 2
      crypto-qti/qcedev.c

+ 2 - 2
crypto-qti/qcedev.c

@@ -402,7 +402,7 @@ void qcedev_cipher_req_cb(void *cookie, unsigned char *icv,
 		return;
 	qcedev_areq = podev->active_command;
 
-	if (iv)
+	if (iv && qcedev_areq)
 		memcpy(&qcedev_areq->cipher_op_req.iv[0], iv,
 					qcedev_areq->cipher_op_req.ivlen);
 	tasklet_schedule(&podev->done_tasklet);
@@ -530,7 +530,7 @@ void qcedev_offload_cipher_req_cb(void *cookie, unsigned char *icv,
 		return;
 	qcedev_areq = podev->active_command;
 
-	if (iv)
+	if (iv && qcedev_areq)
 		memcpy(&qcedev_areq->offload_cipher_op_req.iv[0], iv,
 			qcedev_areq->offload_cipher_op_req.ivlen);