Merge "qcedev: Fix null-ptr-deref in qcedev_cipher_req_cb"

This commit is contained in:
qctecmdr
2023-09-13 14:20:50 -07:00
committed by Gerrit - the friendly Code Review server

View File

@@ -396,7 +396,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);
@@ -524,7 +524,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);