From: sashiko-bot@kernel.org
To: "Ziheng Wei" <zihengw03@163.com>
Cc: virtualization@lists.linux.dev,
"Michael S. Tsirkin" <mst@redhat.com>,
"Eugenio Perez" <eperezma@redhat.com>
Subject: Re: [PATCH] virtio_console: drop device reference when DMA allocation fails
Date: Mon, 23 Nov 2026 10:27:28 +0000 [thread overview]
Message-ID: <sashiko-outbox-229036@kernel.org> (raw)
In-Reply-To: <20261123102321.8605-1-zihengw03@163.com>
> alloc_buf() takes a device reference before dma_alloc_coherent(), but its
> failure label only frees the buffer:
>
> get_device() -> dma_alloc_coherent() fails -> kfree(buf)
> -> device reference is permanently leaked
>
> Release the reference on the failure path as free_buf() does on success.
>
> Found by LLM-assisted static analysis. Build tested with allmodconfig;
> no runtime fault-injection test.
>
> Fixes: 1b6370463e88 ("virtio_console: Add support for remoteproc serial")
> Signed-off-by: Ziheng Wei <zihengw03@163.com>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261123102321.8605-1-zihengw03@163.com?part=1
next prev parent reply other threads:[~2026-11-23 10:27 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-23 10:23 [PATCH] virtio_console: drop device reference when DMA allocation fails Ziheng Wei
2026-11-23 10:27 ` sashiko-bot [this message]
2026-11-24 2:47 ` Jiaming Fan
2026-11-24 7:04 ` Ziheng Wei
2026-11-24 7:27 ` Greg KH
2026-11-24 10:00 ` Ziheng Wei
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=sashiko-outbox-229036@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=eperezma@redhat.com \
--cc=mst@redhat.com \
--cc=sashiko-reviews@lists.linux.dev \
--cc=virtualization@lists.linux.dev \
--cc=zihengw03@163.com \
/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