diff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp
index f41b7a7b3308..260a52018a4d 100644
--- a/src/libcamera/pipeline_handler.cpp
+++ b/src/libcamera/pipeline_handler.cpp
@@ -391,6 +391,8 @@ bool PipelineHandler::hasPendingRequests(const Camera *camera) const
  * This method queues a capture request to the pipeline handler for processing.
  * The request is first added to the internal list of queued requests, and
  * then passed to the pipeline handler with a call to queueRequestDevice().
+ * If the pipeline handler fails in queuing the request to the hardware the
+ * request is immediately completed with error.
  *
  * Keeping track of queued requests ensures automatic completion of all requests
  * when the pipeline handler is stopped with stop(). Request completion shall be
@@ -409,8 +411,19 @@ void PipelineHandler::queueRequest(Request *request)
 	request->sequence_ = data->requestSequence_++;
 
 	int ret = queueRequestDevice(camera, request);
-	if (ret)
+	if (ret) {
+		/*
+		 * Cancel the request and notify completion of its buffers in
+		 * error state. Then complete the cancelled request and remove
+		 * it from the queued requests list.
+		 */
+		request->cancel();
+		for (auto bufferMap : request->buffers())
+			camera->bufferCompleted.emit(request, bufferMap.second);
+
+		camera->requestComplete(request);
 		data->queuedRequests_.remove(request);
+	}
 }
 
 /**
