spin_unlock_bh(&backlog->lock);
 }
 
-static void qat_alg_backlog_req(struct qat_alg_req *req,
-                               struct qat_instance_backlog *backlog)
-{
-       INIT_LIST_HEAD(&req->list);
-
-       spin_lock_bh(&backlog->lock);
-       list_add_tail(&req->list, &backlog->list);
-       spin_unlock_bh(&backlog->lock);
-}
-
-static int qat_alg_send_message_maybacklog(struct qat_alg_req *req)
+static bool qat_alg_try_enqueue(struct qat_alg_req *req)
 {
        struct qat_instance_backlog *backlog = req->backlog;
        struct adf_etr_ring_data *tx_ring = req->tx_ring;
        u32 *fw_req = req->fw_req;
 
-       /* If any request is already backlogged, then add to backlog list */
+       /* Check if any request is already backlogged */
        if (!list_empty(&backlog->list))
-               goto enqueue;
+               return false;
 
-       /* If ring is nearly full, then add to backlog list */
+       /* Check if ring is nearly full */
        if (adf_ring_nearly_full(tx_ring))
-               goto enqueue;
+               return false;
 
-       /* If adding request to HW ring fails, then add to backlog list */
+       /* Try to enqueue to HW ring */
        if (adf_send_message(tx_ring, fw_req))
-               goto enqueue;
+               return false;
 
-       return -EINPROGRESS;
+       return true;
+}
 
-enqueue:
-       qat_alg_backlog_req(req, backlog);
 
-       return -EBUSY;
+static int qat_alg_send_message_maybacklog(struct qat_alg_req *req)
+{
+       struct qat_instance_backlog *backlog = req->backlog;
+       int ret = -EINPROGRESS;
+
+       if (qat_alg_try_enqueue(req))
+               return ret;
+
+       spin_lock_bh(&backlog->lock);
+       if (!qat_alg_try_enqueue(req)) {
+               list_add_tail(&req->list, &backlog->list);
+               ret = -EBUSY;
+       }
+       spin_unlock_bh(&backlog->lock);
+
+       return ret;
 }
 
 int qat_alg_send_message(struct qat_alg_req *req)