Linux Media Controller development
 help / color / mirror / Atom feed
* [PATCH] media: mc: Reject disconnected pads on an active pipeline
@ 2026-11-24 16:37 Anthony McGivern
  2026-12-03  8:05 ` Linus Walleij
  0 siblings, 1 reply; 3+ messages in thread
From: Anthony McGivern @ 2026-11-24 16:37 UTC (permalink / raw)
  To: linux-media
  Cc: Anthony McGivern, Vincenzo Frascino, Nayden Kanchev,
	Konstantin Babin, Linus Walleij, Mauro Carvalho Chehab,
	Hans Verkuil, laurent.pinchart, Sakari Ailus, Anthony McGivern

From: Anthony McGivern <Anthony.McGivern@arm.com>

When starting an already active media pipeline, graph validation is skipped
and its start count is incremented. This allows a disconnected origin pad
to return success even though it does not belong to a pipeline.

Reject a disconnected origin pad with -EINVAL before incrementing the
start count.

Signed-off-by: Anthony McGivern <Anthony.McGivern@arm.com>
---
 drivers/media/mc/mc-entity.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/media/mc/mc-entity.c b/drivers/media/mc/mc-entity.c
index 7938f785e2e3c76372a585426faa0482d78083ef..4508afacdd68e2a9ab81261561997317ab525662 100644
--- a/drivers/media/mc/mc-entity.c
+++ b/drivers/media/mc/mc-entity.c
@@ -791,10 +791,13 @@ __must_check int __media_pipeline_start(struct media_pad *origin,
 		return -EINVAL;
 
 	/*
-	 * If the pipeline has already been started, it is guaranteed to be
-	 * valid, so just increase the start count.
+	 * If the pipeline has already been started, ensure the pad is a part of the pipeline.
+	 * If so, it is guaranteed to be valid, so just increase the start count.
 	 */
 	if (pipe->start_count) {
+		if (!origin->pipe)
+			return -EINVAL;
+
 		pipe->start_count++;
 		return 0;
 	}

---
base-commit: b6a9fa34ce4187cb69d3c588a4bbffc31ce5db8f
change-id: 20261124-mali-c720-media-controller-fix-3efb64d9cd6d

Best regards,
-- 
Anthony McGivern <Anthony.McGivern@arm.com>


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-12-03 12:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-24 16:37 [PATCH] media: mc: Reject disconnected pads on an active pipeline Anthony McGivern
2026-12-03  8:05 ` Linus Walleij
2026-12-03 12:23   ` Anthony McGivern

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox