Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [High] media: buffer leak in start_streaming due to bypassed goto cleanup --
commit 5bdfbd6c853742afe356643c25551aec647f2e92 Author: Sakari Ailus sakari.ailus@linux.intel.com
media: ipu6: Prevent starting streaming if ISYS needs reset
Fail starting streaming whenever ISYS needs to be reset to resume normal operation.
diff --git a/drivers/media/pci/intel/ipu6/ipu6-isys-queue.c b/drivers/media/pci/intel/ipu6/ipu6-isys-queue.c index 6596833e95d49..978acbd72e63f 100644 --- a/drivers/media/pci/intel/ipu6/ipu6-isys-queue.c +++ b/drivers/media/pci/intel/ipu6/ipu6-isys-queue.c @@ -481,6 +481,11 @@ static int start_streaming(struct vb2_queue *q, unsigned int count) av->vdev.name, ipu6_isys_get_frame_width(av), ipu6_isys_get_frame_height(av), pfmt->css_pixelformat);
- scoped_guard(mutex, &av->isys->mutex) {
if (av->isys->need_reset)return -EIO;
[Severity: High] Does this direct return bypass the required buffer cleanup?
The start_streaming videobuf2 callback requires that if an error is returned, any buffers previously queued to the driver must be explicitly returned. The existing error paths handle this by jumping to out_return_buffers, which calls return_buffers(aq, VB2_BUF_STATE_QUEUED).
Could returning directly here leave these buffers stranded on the driver's internal incoming list? Mixing scoped_guard with goto-based cleanup in the same function can easily cause resource leaks like this.
- }
- remote_pad = media_pad_remote_pad_unique(&av->pad); if (IS_ERR(remote_pad)) { dev_dbg(dev, "failed to get remote pad\n");