From: Dan Carpenter <dan.carpenter@linaro.org>
To: Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com>
Cc: Abhinav Kumar <abhinav.kumar@linux.dev>,
linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org,
linux-kernel <linux-kernel@vger.kernel.org>
Subject: [bug report] media: iris: gen1: Destroy internal buffers after FW releases
Date: Fri, 6 Feb 2026 16:39:52 +0300 [thread overview]
Message-ID: <aYXvKAX3Pg3sL37P@stanley.mountain> (raw)
In-Reply-To: <caa37f28-a2e8-4e0a-a9ce-a365ce805e4b@stanley.mountain>
[ Smatch checking is paused while we raise funding. #SadFace
https://lore.kernel.org/all/aTaiGSbWZ9DJaGo7@stanley.mountain/ -dan ]
Hello Dikshita Agarwal,
Commit 1dabf00ee206 ("media: iris: gen1: Destroy internal buffers
after FW releases") from Dec 29, 2025 (linux-next), leads to the
following Smatch static checker warning:
drivers/media/platform/qcom/iris/iris_buffer.c:588 iris_release_internal_buffers()
error: dereferencing freed memory 'buffer' (line 585)
drivers/media/platform/qcom/iris/iris_buffer.c
572 static int iris_release_internal_buffers(struct iris_inst *inst,
573 enum iris_buffer_type buffer_type)
574 {
575 const struct iris_hfi_command_ops *hfi_ops = inst->core->hfi_ops;
576 struct iris_buffers *buffers = &inst->buffers[buffer_type];
577 struct iris_buffer *buffer, *next;
578 int ret;
579
580 list_for_each_entry_safe(buffer, next, &buffers->list, list) {
581 if (buffer->attr & BUF_ATTR_PENDING_RELEASE)
582 continue;
583 if (!(buffer->attr & BUF_ATTR_QUEUED))
584 continue;
585 ret = hfi_ops->session_release_buf(inst, buffer);
The commit adds a free of buffer to ->session_release_buf().
586 if (ret)
587 return ret;
--> 588 buffer->attr |= BUF_ATTR_PENDING_RELEASE;
^^^^^^^^^^^^
Use after free.
589 }
590
591 return 0;
592 }
regards,
dan carpenter
next prev parent reply other threads:[~2026-02-06 13:39 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <caa37f28-a2e8-4e0a-a9ce-a365ce805e4b@stanley.mountain>
2026-02-06 13:39 ` [bug report] media: synopsys: add driver for the designware mipi csi-2 receiver Dan Carpenter
2026-02-06 13:39 ` [bug report] media: rockchip: rkcif: add support for rk3568 vicap mipi capture Dan Carpenter
2026-02-16 13:33 ` Michael Riesch
2026-02-06 13:39 ` Dan Carpenter [this message]
2026-02-06 13:40 ` [bug report] media: chips-media: wave5: Fix Null reference while testing fluster Dan Carpenter
2026-02-11 7:59 ` Nas Chung
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aYXvKAX3Pg3sL37P@stanley.mountain \
--to=dan.carpenter@linaro.org \
--cc=abhinav.kumar@linux.dev \
--cc=dikshita.agarwal@oss.qualcomm.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox